Worksheet: J7
Worksheets are self-guided activities that reinforce lectures. They are not graded for accuracy, only for completion. Worksheets are due by Sunday night before the next lecture.
Note
Attempt to answer these questions before running the code. This will improve your ability to analyize and reason about code without an IDE or compiler. This skill we be helpful on the exams.
This worksheet combines topics from the Software Testing lecture as well as today’s lecture.
Questions
-
What is fault localization?
-
What are three benefits of Test Driven Development (TDD)?
-
Given the example of requirements for generating a password:
- It must have at least one number.
- It must have at least one uppercase letter.
- It must have at least one lowercase letter.
- It must not contain the website gmail anywhere. (For example if we were generating a password for gmail accounts)
- It can only be made up of letters, numbers, and the underscore.
What are the input domain paritions for this exercise?
-
Complete the truth table below to show what inputs we need to achieve active clause coverage for the following conditional:
if ( ( (a > b) or G ) and (x < y) )
a > b G x < y predicate outcome clause responsible -
Consider the control flow graph below. What are all the paths (using node numbers) that would achieve full path coverage as a test criteria? Is this a finite set?
-
What benefit does mutation testing offer over other testing methods discussed in class?
-
Convert your
DriverJava1_sample.java
file from the previous lecture into a Junit test file with the following elements:- a single unit test for every input class (give it the name of that input partition)
Assume that the method under test is called
checkCode
that takes a string as an argument and returns a boolean value whether or not the input was a valid code.