Tag Archives: Testability

A Quick Way to Identify Code with Low Testability

Following is a quick way to identify code with low testability and hence low maintainability: Take any specific public method of the class Count for number of decision points such as following: – If – For – While – Switch – Inline ifs If the number of decision points in a method is more than 15 or so, it could be taken as indication that it may get difficult to write unit tests covering all possible flows. Thus, the code will have lower testability. The number of decision points in a method is also used to define/measure cyclomatic complexity of the method, or more specifically, McCabe Cyclomatic Complexity. Thus, mathematically …

Continue reading

Posted in Maintainability, Software Quality, Unit Testing. Tagged with .

Test-Along Development (TAD): Unit testing technique

While talking to one of the client stakeholder, I came across this interesting term as Test-Along Development. Following are two different techniques I came across as common way of writing unit test: Test-driven development where we write unit tests first and then write enough code to make unit tests pass Write unit tests at the end once you are done with the development. Both of the above techniques presented enough challenges to the software developers. Some of them are following: Test-driven development: In agile development, in 2 week sprints, the design took much longer than 2-3 days. Thus, doing test-driven development was found to lead carry-overs for sprint given on …

Continue reading

Posted in Maintainability, Software Quality, Unit Testing. Tagged with , , .

Unit Tests & What do they say?

Ask software developers about what do they mean by unit testing, and if they believe in it? And, the answer you get are some of the following: Unit testing is about writing tests for each of the method of the class. It is written only when you get some extra time after the code completion? Unit testing is done only when we are asked by our customers. Unit testing takes additional time and hence, done only if time permits. Test-driven development… What is that? Not sure if there are any benefits by writing unit tests? Test coverage… What is that? Why do we write unit tests when we are software …

Continue reading

Posted in Software Quality. Tagged with , , .