The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
50 views

What's good about statement coverage?

When it comes to code coverage, you often hear about the flaws of statement coverage criteria. We're told that statement does not take into account control structures and branches thereof, and is ...
5
votes
1answer
109 views

How do you unit-test code using graphs?

I am writing (recursive) code that is navigating a dependency graph looks for cycles or contradictions in the dependencies. However, I am not sure how to approach unit testing this. The problem is ...
3
votes
2answers
103 views

Separate code coverage reports for unit and integration tests, or one report for both?

Should there be a separate code coverage report for unit and integration tests, or one code coverage report for both? The thinking behind this is that code coverage allows us to make sure that our ...
4
votes
2answers
133 views

Is it ok to write “extra” unit tests?

My understanding of how TDD should work is that you write a failing test for the next bit of functionality you want to add to a function or object, code until the test passes and then write the next ...
-4
votes
1answer
132 views

How does code coverage work?

Specifically, what is contained inside code coverage data (.nccov or xml file) and how is an html report generated by this? Does the coverage data not include the actual percentage of code covered? Is ...
1
vote
2answers
411 views

What is “condition testing” (as defined by the ISTQB Syllabus) actually good for? [duplicate]

I am currently checking through the syllabus for the ISTQB "Technical Test Analyst" certification. This syllabus (henceforth called "TTA syllabus") contains a chapter dedicated to "condition testing" ...
2
votes
1answer
582 views

equals and hashcode methods autogenerated, is it always a good practice?

Preamble: Let's say I aim to cover all my classes with test coverage. Despite the common opinion (expecially in Java community) to "not pay too much attention to Cyclomatic Complexity (CC) and code ...
1
vote
5answers
464 views

How to unit test a missing case in a switch statement where all cases are true

I often use enum types in my code with a switch to apply logic to each type. In these cases it's important that each enum has code implemented. For example; public enum eERROR { REQUIRED, ...
1
vote
1answer
107 views

Does condition coverage subsume edge coverage?

I'm a little bit confused about code coverage criteria; especially condition and edge coverage. As stated in this book, edge coverage does not subsume condition coverage; BUT my lecture material ...
3
votes
5answers
861 views

Best practice for code coverage of empty interface methods

Given a class that implements an interface, but does not need all of the methods implemented, what is the best practice for unit testing this class with respect to code coverage? - or is it considered ...
9
votes
10answers
997 views

Any tools/suggestions on how to refute code coverage quality argument

Now I know people could consider this question duplicate or asked many times, in which case I would appreciate a link to relevant questions with answer to my question. I have been recently in ...
3
votes
1answer
119 views

Verification for value of test standards

We are currently developing a concept for our tests standards. Up until now, we don't have standards. All we do is to tell the developer to write tests. Now we have the following basic idea: We will ...
1
vote
1answer
3k views

Condition coverage for If(A && B) - measuring the input or code exercised?

I have been studying condition coverage for last few days. In a book "The Art of Software Testing" they highlight that it does not assure decision coverage, because for example IF(A && B) ...
0
votes
1answer
145 views

What the white box testers create test cases against?

I'm wondering, what are the white box testers using to create test cases? The actual code? Some kind of diagrams? I mean, if I am given a task to create test cases for complete branch coverage, is it ...
4
votes
5answers
2k views

Is path coverage stronger than condition coverage?

I have encountered (even in literature) two contradicting opinions related to path vs condition coverage (not branch or edge!). Some say Path coverage is stronger than the condition coverage, some say ...
12
votes
2answers
539 views

How do I know if I have enough unit test coverage to remove an integration test?

I'm working on a legacy system (by that I mean it was written without tests). We've tried to test some of the system by writing integration tests that test functionality from the outside. This ...
3
votes
3answers
380 views

Is unconditional code considered a branch?

Having simple code like this: int A=5; object X=Console.ReadLine() if(Condition) DoSomething(); else DoStuff(); DoSomethingElse(); Some sources say there are actually 4 branches: First ...
3
votes
3answers
7k views

Branch vs decision coverage question

ISTQB does not distinct between these (it reads "Branch/decision coverage") but some sources do say it is different. I would have two question. The essential one is about the difference. And the other ...
2
votes
2answers
241 views

Unit test and Code Coverage of Ant build scripts

In our development environment We have more and more build scripts for ant to perform the build tasks for several different build jobs. These build scripts sometimes become large and do a lot of ...
13
votes
3answers
1k views

How would you test Google Maps “Get Directions” feature?

(I imagine this would be a good interview question, but in my case it's more pragmatic than that.) We have a large & complex application that models an extremely long and sophisticated chemical ...
5
votes
2answers
3k views

How do you handle measuring Code Coverage in JavaScript

In order to measure Code Coverage for JavaScript unit tests, one needs to instrument the code, run the tests and then perform post-processing. My concern is that, as a result, you are unit testing ...
19
votes
4answers
2k views

How to drastically improve code coverage?

I'm tasked with getting a legacy application under unit test. First some background about the application: It's a 600k LOC Java RCP code base with these major problems massive code duplication no ...
12
votes
5answers
910 views

How can I design test cases to cover code based on random events?

For example, if the code generates a random int from 0-10, and takes a different branch on each outcome, how can one design a test suite to guarantee 100% statement coverage in such code? In Java, ...
5
votes
4answers
225 views

Is it realistic to ask your team to take on a 100% automated test coverage goal as a stretch task?

In a financial services environment - is it realistic to ask your team of ten programmers to take on a 100% automated unit and integration test coverage goal as a stretch task for a legacy java system ...
0
votes
1answer
52 views

How do you define a node and an edge when talking about McCabes Complexity?

I am trying to understand the formula, but I am a bit in doubt how exactly you define edges and nodes. Edges seem to be every possible exit from a statement and nodes seem to be statements, is this ...
1
vote
1answer
226 views

How to get good scenario coverage in performance benchmarks?

If it is relatively easy to get good code coverage from profiling (because profiling tells you which functions are/aren't called, how many times, and with what parameters), how do I get good ...
6
votes
4answers
416 views

Unit testing internal components

To what extent do you unit test internal/private components of a class/module/package/etc? Do you test them at all or do you just test the interface to the outside world? An example of these internal ...
2
votes
4answers
329 views

Reasonable test coverage requirements when dealing with a contractor?

We're outsourcing some work to an external developer, so I'm busy writing up a contract about what constitutes a deliverable. So far I require that the code is shipped with automated tests. But, ...
31
votes
7answers
4k views

What should you test with unit tests?

I'm freshly out of college, and starting university somewhere next week. We've seen unit tests, but we kinda not used them much; and everyone talks about them, so I figured maybe I should do some. ...
11
votes
7answers
949 views

Is test coverage an adequate measure of code quality?

If I have some code that has 80% test coverage (all tests pass), is it fair to say that it's of higher quality than code with no test coverage? Or is it fair to say it's more maintainable?