Worksheet: J1 | CS 2113 Software Engineering - Fall 2023

Worksheet: J1

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.

Create a new repo using all the steps in Lab 0 called yourgitusername-worksheet-J1.

Please submit your answers to the questions as comments in the java file you’ll be writing in this lab, which you should add to your repo.

Questions

  1. What is fault localization?

    Reveal Solution

  2. What are three benefits of Test Driven Development (TDD)?

    Reveal Solution

  3. 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?

    Reveal Solution

  4. 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

    Reveal Solution

  5. 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?

    flow

    Reveal Solution

  6. What benefit does mutation testing offer over other testing methods discussed in class?

    Reveal Solution

  7. 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) – if you have more than 20 tests, you can skip the rest.

    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.

    This is how we will also record that you attempted the in-class example from lecture. Your code doesn’t need to compile.

    Reveal Solution