JMU CS345 - Software Engineering
Help Policies Solutions Study-Aids Syllabus Tools
Sample Questions for Examination 2


    Construction
  1. Create a test suite that will test every branch of the calculate() method in the following Utility class. Note: Do not use JUnit. Just list the value of x and y and the expected return value for each test case. Hint: Recall that we distinguished between branch coverage, condition coverage and multiple condition coverage. This question is about branch coverage.
    public class Utility
    {
      public static int calculate(int x, int y)
      {
        int       a, b;
    
        do
        {
          a = 1;                 // S1
           
          if (x > y)             // S2
          {
            a = 2;               // S3
          }
    
          x++;                   // S4
          b = x * a;             // S5
        }
        while (b <= 0);          // S6
           
        return b;                // S7
      }
    }
    
  2. Suppose S2 above was changed to if ((x > y) && (x < 100)), how many branches would need to be covered (for 100% branch coverage)?
  3. How many branches would need to be covered (for 100% branch coverage) in the following statement: if ((i < 0) || (i > 10))?
  4. How many conditions would need to be covered (for 100% condition coverage) in the following statement: if ((i < 0) || (i > 10))? Hint: This question is about what we call condition coverage (i.e., what EclEmma/JaCoCo mistakenly calls branch coverage).
  5. Briefly, but carefully, define each of the following terms:
    Debugging


    Regression Testing


    Static Analysis


    Test Case (or Test Point)


    Trigger Condition


  6. Compare and contrast two different kinds of code review.
  7. Define the term "Test Driven Development".
  8. List three different kinds of conventions that are often included in style guides.
  9. Order the following debugging actions (which are currently in alphabetical order) based on when they would be performed in the normal work cycle. You may use an action more than once.
    • Correction
    • Globalization
    • Localization
    • Stabilization
    • Verification
  10. Carefully explain how tools can be used to make alpha testing more efficient. You must think about the problem both from the perspective of the tester and the programmer.
  11. Explain how "assert methods" are used in JUnit testing.
  12. For this question you must create a simple Java class and a JUnit test suite for it.
    1. Create a Money class that satisfies all of the following specifications.
      1. It must have a dollars attribute.
      2. It must have a cents attribute.
      3. The cents attribute must never be greater than or equal to 100. If a call to any method would result in such a value, that method must adjust both the cents and dollars attributes appropriately.
      4. It must have a default constructor that creates a Money object with 0 dollars and 0 cents.
      5. It must have an explicit value constructor that is passed in the initial value for dollars and cents.
      6. If the explicit value constructor is passed a negative value for either dollars or cents both attributes must be initialized to 0.
      7. It must have an increaseBy() method that is passed another Money object and increases the owning object accordingly.
      8. It must have a toString() method that returns a string representation of the owning object formatted appropriately (i.e., with a leading '$', a '.' between the dollars and cents, and exactly two digits for the cents.
    2. Create a JUnit test suite that could be used to test the Money class in the previous question. Your test suite must have 100% statement and branch coverage, and must use appropriate value heuristics.
  13. Given the obvious implementation (without any validation of parameters) of the Coin class in the following UML diagram:
    Coin-Metal.png
    1. Write a suite of JUnit tests that covers every method, statement, and branch in the Coin class.
    2. Given the information you have available to you, why could you not write such a JUnit test suite for the Metal class, even though it only has one method?
  14. Deployment, Support, and Maintenance
  15. Briefly, but carefully, define each of the following terms:
    Preventive Maintenance


    Response Time (as it is used in Maintenance)


    Physical Architecture


  16. Carefully explain the difference between the following two physical architectures: mainframe and cloud.
  17. The following UML Deployment Diagram describes the way in which the (fictitious) company Nearby deploys their product named DogGone, a GPS-equipped dog collar monitoring system.

    DogGoneDeployment.png

    1. Is the DogGoneTracker "permanently" installed on the user's smartphone or is it installed each time it is used?
    2. Is the DogGoneReporter "permanently" installed on the DogGoneCollar or is it installed each time it is used?
    3. What maintenance issues arise as a result of your answers to the previous two questions?
    4. On which device is the correspondence between pets and owners determined.
    5. How much data bandwidth (in a qualitative sense) is required by this deployment? Explain.
  18. Explain the difference between synchronous support and asynchronous support. Which is provided by the JMU Help Desk?
  19. Project Management
  20. Describe two (we discussed four) different management activities. In Scrum, which participants are responsible for each of these activities?
  21. The following questions are all concerned with burn-up charts.
    1. In a burn-up chart, earned value can be measured in a variety of different ways, one of which is story points. Provide a concise definition of story points.
    2. Describe the shape of the plot of the planned value (in a burn-up chart) when story points are used.
    3. In a burn-up chart with the business value measure in dollars on the vertical axis and the sprint number on the horizontal axis, how do you find the schedule variance measured in dollars at the end of a particular sprint?
    4. In a burn-up chart with the business value measure in dollars on the vertical axis and the sprint number on the horizontal axis, how do you find the schedule variance measured in weeks at the end of a particular sprint?
  22. Using regression analysis and industry-wide data about effort, \(E\) (measured in person-months), and output measured in thousands of lines of code, \(L\) or measured in function points, \(F\), Basili and Freburger (1981) estimated the following relationship: \[ E = 1.38 L^{0.93} \]

    whereas Kemerer (1987) estimated the following relationship:

    \[ E = -37.0 + 0.96 F \]
    1. Using the Basili and Freburger model, about how much effort is required to produce 2000 lines of code?
    2. Current estimates are that, in languages like C++, Java and JavaScript, every function point corresponds to about 50 lines of code. Using this correspondence and the Kemerer model, about how much effort is required to produce 2000 lines of code?
  23. In bottom-up integration testing, after the modules are unit-tested they are iteratively combined into subsystems and tested. This means that the larger subsystems can't be tested until after the smaller subsystems are.

    Suppose for a given product the testing dependencies and testing times (in days) are as follows:

    Subsystem Earlier Optimistic Likely Pessimistic
    to Test Subsystems Time Time Time
    1 1 3 5
    2 1 4 5 12
    3 1 2 3 4
    4 1 3 5 7
    5 2 2 3 10
    6 3,4 2 5 20
    7 4 4 5 12
    8 2,5,6 2 4 12
    9 6,7 1 3 5
    10 8,9 2 4 18

    where the optimistic time is denoted by \(t_o\), the (most) likely time is denoted by \(t_m\), and the pessimistic time is denoted by \(t_p\).

    1. Assuming the expected time to test each subsystem is given by \( E[t] = \frac{1}{3}\left[ 2 t_m + \frac{1}{2} (t_o + t_p) \right] \), calculate the expected time to test each subsystem.
    2. Construct a dependency graph for this test plan using the expected times as the task times.
    3. Using the algorithm we discussed in lecture, find the critical path. Show your work on the dependency graph.
    4. How much can the testing of subsystem 6 slip without changing the total time required to test?
    5. How much can the testing of subsystem 3 slip without changing the total time required to test?
  24. The Harrisonburg Kennel Club has become very interested in using a customized version of DogGone, a GPS-equipped dog collar monitoring system, at their events starting next year (for a period of 10 years). Nearby (the company that developed DogGone) has told them that it will cost $100,000 to develop the custom version (with payment required up front). Alternatively, the Harrisonburg Kennel Club can license a competitor's existing product for $10,000 for the first 5 years and for $15,000 for the next 5 years (with payment required at the start of each year).

    Given that the Harrisonburg Kennel Club can borrow money at an interest rate of 4%, that they must enter into a 10 year contract, and that they will use the software for exactly 10 years, should they buy the system from Nearby or license the competitive product? In other words, calculate the present value of the lease and compare it to the up-front cost of the purchase. Show all of your work.

  25. Comprehensive Questions
  26. Indicate the best match for each of the following:
    _____ A visualization used for performance tracking
    _____ A visualization used for scheduling
    _____ A visualization of a physical architecture
    1. A Gantt Chart
    2. A Burn-Up Chart
    3. A UML Deployment Diagram
  27. Indicate the best match for each of the following:
    _____ Talking to a user to improve their experience
    _____ Performing unit tests
    _____ Keeping the product usable in a changing environment
    _____ Installing the software on the physical architecture
    _____ Debugging
    _____ Acquiring necessary resources
    1. As Part of Project Management
    2. During Implementation/Construction
    3. During Deployment
    4. While Providing Support
    5. During Maintenance
  28. Tools
  29. Indicate the best match for each of the following:
    _____ A testing framework
    _____ A dynamic analysis tool
    _____ A Java documentation tool
    _____ A static analysis tool
    _____ A code management tool
    1. JUnit
    2. Git
    3. EclEmma/JaCoCo
    4. Checkstyle

Copyright 2024