Basic Concepts and Preliminaries
Software Security, Testing, and Quality Assurance
Homework 2: Basic Concepts and Preliminaries, Theory of Program Testing, Unit Testing Spring 2021
- The functional specification for the Temperature Conversion Program is already given (in another document – attached). In the class we created few test cases from that requirements document. In this exercise you will:
- Create twenty (25) test cases from Requirements 3 and 4, and 5 and give them (in a Word file) as a table (see example below). Be sure to create test cases from the boundary conditions.
Test Case No. |
Requirement No. |
Input (FromTempTyp, ToTempTyp, Value) |
Expected Output |
- Execute ten (10) of those test cases manually and show the observation along with a conclusion for each test case as a table with four columns: Test Case No., Requirement
Test Case No. |
Input |
Original Program Expected Output |
Original Program Observed Output |
Mutant Tests: Observed Output | |||||
Mutant1 |
Mutant2 |
Mutant3 |
Mutant4 |
Mutant5 |
Mutant6 |
No., Observed Output, and Conclusion. Conclude whether the test passed or failed for each test case.
- Execute the other fifteen (15) test cases by writing and running a Windows batch (or Unix/Linux script) file to execute (using simple Windows or Unix/Linux shell commands) automatically and output to the test results in an output file. The batch file (or the script) must first compile the source code before executing the test cases. Submit the batch/script file and the test result output file by naming the batch/script as your first initial followed by last name (one word) followed by the extension .bat (windows) or .sh (Unix/Linux). Name the output file as your first initial last name followed by _output with extension
.txt.
- The test cases that failed from part (b) enter a description of the observation in the bug report on MantisBT. You will submit a report from MantisBT and include it with your submission. Name the report file as your first initial last name followed by _report with appropria extension.
- A test engineer generates 80 mutants of a program P and 120 test cases to test the program P. After the first iteration of mutation testing, the tester finds 60 dead mutants and 5 equivalent mutants. Calculate the mutation score for this test suite. Is the test suite adequate for program P? Should the test engineer develop additional test cases? Justify your answer.
- Given the code java develop six (6) test cases and six (6) mutants and then give the test results in tabular form using the following:
- Give the source code for all of the mutants (java,
Commission2.java, Commission3.java, Commission4.java,
Commission5.java, and Commission6.java) that you created as a zip file.
- Give a batch file (bat) with your name prefix in the file name to compile and run all the mutants and the original (unaltered) code automatically.
- Provide the output of running the batch file named as txt with your name prefix in the file name
- Give the changed lines of the program code for each mutant (before and after) and then compute the mutation score of your test (in Word document).
- The code listing for the Number Conversion Program is already given (java – attached). This program converts numbers between bases (e.g., binary to decimal, decimal to hexadecimal, etc.), and verifies if a number is valid for its base. It has four methods (program units) named: dec2any, any2dec, any2any, and isValidInBase. Write a test class named TestNumberConversion.java to do the unit test of the four program units. In this exercise you will:
- Develop and give (in Word document) the dynamic unit test cases for each of the units to run test in the JUnit framework (using table similar to Q1a).
- Write a JUnit test class named java containing all the appropriate methods that will have the call to assertion methods for the unit test of methods in NumberConversion.java.
- Provide a windows command batch file (named bat with your name prefix) that will contain commands for compiling and running of the files
NumberConversion.java and TestNumberConversion.java from a command windows.
Windows Batch Files: Compiling and running a program from a Windows batch file must first check for the existence of the class file before deleting it. A compilation step must check for the existence of the source file and ensure that compilation succeeded before running it.
Note: submit all files zipped into one zip file and name the zip file by following file naming instruction given in D2L. You will incur penalty for not following the file naming requirements.
Resources
- 24 x 7 Availability.
- Trained and Certified Experts.
- Deadline Guaranteed.
- Plagiarism Free.
- Privacy Guaranteed.
- Free download.
- Online help for all project.
- Homework Help Services