Showing posts with label Automated Testing. Show all posts
Showing posts with label Automated Testing. Show all posts

Automated Tests as an Aid to Debugging


So, what makes automated tests valuable when debugging? They help out at all stages:

� First and foremost, well-tested code tends to have fewer bugs in the first place. The easiest bug to fix is the bug that never existed.

� The shorter the delay between a mistake being made and subsequently being discovered, the easier and cheaper it is to fix. Early testing means that most bugs are discovered very shortly (often immediately) after they�re introduced.

� Automated testing is a key enabler of continuous integration, in which code is integrated with the whole product as soon as it�s complete.  

� Automated tests allow you to frequently release new versions of the software with high confidence that the new release is functional. This means that you get end-user feedback on new features and bug fixes much more quickly than would otherwise be the case (again, reducing the time between code being written and bugs being discovered within the code). It can also reduce the need to back-port bug fixes to previous versions of the software or to release patches.

� For code to be tested, it needs to be structured in such a way as to provide access to intermediate results and internal state that might otherwise be unavailable. This kind of access turns out to be a great help during later debugging.

� Writing a test is an excellent way to reproduce a bug during the diagnostic process. Many of the techniques created to support automated testing are extremely useful for reliably reproducing bugs.

� After you�ve completed your diagnosis, automated tests provide powerful protection against the fix introducing regressions.

� If, during diagnosis, you make a habit of always writing a test that reproduces the bug, you naturally end up with a regression test that ensures that the bug won�t be reintroduced at some point in the future.

� Automated tests are a key enabler of refactoring, which is the most powerful weapon at your disposal to ensure that code remains well-structured and flexible throughout its lifetime.

Automated tests are a particularly powerful debugging tool when allied with a technique that has risen in popularity alongside them�test doubles.

Source of Information :  Paul Butcher - Debug it Find repair and prevent bugs

Effective Automated Testing

Agile software development has dramatically changed software construction through the widespread adoption of automated testing and refactoring. There�s more to effective automated testing than simply automating your tests. To achieve maximum benefit, your tests need to satisfy the following goals:

Unambiguous pass/fail: Each test outputs a single bit�pass or fail. No shades of gray, no qualitative output, no interpretation required. Just a simple yes or no.

Self-contained: No setup required before running a test. Before it runs, it sets up whatever environment it needs automatically, and just as important, it undoes any changes to the environment afterward, leaving everything as it found it.

Single-click to run all the tests: All tests can be run in one step without interfering with each other. As with a single test, the output of the complete test suite is a simple pass or fail�pass if every test passes, fail otherwise.

Comprehensive coverage: It�s easy to prove that achieving complete coverage for any nontrivial body of code is prohibitively expensive. But don�t allow that theoretical limitation to put you off�it is possible to achieve close enough to complete coverage as to make no practical difference.

Source of Information :  Paul Butcher - Debug it Find repair and prevent bugs
 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Information Computer and Technology - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger