Skip to content

Exercise 2: Input Domain Modeling

You are asked to design an input domain model (IDM) for testing the Sitodo PMPL. Specifically, you have to create an IDM for testing at least two features as unit tests in the project's codebase.

Once you have the IDM, you need to define the test values (i.e. the input values) by following a coverage criteria of your choice such as All Combination Coverage (ACoC) or Pairwise Coverage (PWC). You can use a template for the IDM that is available in Markdown or Microsoft Word.

Finally, update the existing JUnit unit test suites in the project's codebase by adding new test cases (as JUnit test methods). Write the new test cases as a JUnit test suite class in a new test package named com.example.sitodo.inputspace, which should be located in the src/test/java/com/example/sitodo/inputspace folder of the project's codebase once you have created it correctly. Even though there might be some overlap with the existing test suites, you still need to write the test cases because it is part of the exercise.

We also provide an IDM example from past exercise if you require a reference on how to create an IDM.

Tasks

  1. Fork the Sitodo PMPL repository to your own account on GitLab CS.

    Please note that the upstream (original) repository in the above link is different from Sitodo PMPL project used in previous exercises. Hence, make sure you complete this exercise on the correct fork of the project!

  2. Clone the Git repository of the new fork into your local development machine.
  3. Open the cloned Git repository as a project using your favourite text editor or IDE that supports Java-based project.
  4. Create a new branch named exercise2 from the main branch of your cloned fork.
  5. Choose two methods from the codebase that correspond to the features you want to test.
  6. Create the input domain model for each method you picked.

    Please choose whether to follow interface-based (syntax) or functionality-based approach (behaviour) for each feature/method when trying to identify the characteristics and their partition. Explain your reason to choose your selected approach in your written documentation.

  7. Identify the constraints among characteristics, if exists.

    Remember that specifying constraints in the IDM can help filtering out unfeasible test values values from being picked up, thus may reduce the number of possible test cases.

  8. Determine the test values based on your resulting IDM. Feel free to use any criteria that you think is the most effective.
  9. Update the existing JUnit test suites by implementing new test methods based on your identified test values from previous step.

    Add the new test methods into a new JUnit test suite class and put the new test suite class into a new package named com.example.sitodo.inputspace.

  10. Do not forget to commit and push your changes to your fork on GitLab CS!

Deliverables

At the end of this exercise, you are required to prepare the following artifacts:

  • A written document that describes the process of your work in completing this exercise. You can write the document as a Markdown-formatted text file or a PDF file. Give the document a descriptive name, e.g. exercise2.md, and put it into a folder called docs in your fork codebase.
  • Two or more added test suites. Please commit any changes to the test suites into separate branch named exercise2 from your main branch in your fork codebase.

The due date of this exercise is: 24 November 2023, 23:59 UTC+7. Please ensure any updates to the fork repository related to this exercise were made and pushed before the due date.

References

Appendix 1: Markdown Template

You can use the following Markdown template to document the IDM in your exercise2.md file.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ISP Documentation for [Insert Function Name Here]

## Input Domain Model

| Characteristics  | b1            | b2            | ... |
|------------------|---------------|---------------|-----|
| Characteristic A | Partition A 1 | Partition B 2 |     |
| Characteristic B | Partition B 1 | ...           |     |
| ...              | ...           | ...           |     |

Note: You can write some explanation about how you design your IDM to help you
during demonstration.

## IDM Relabeling Table

| Characteristics | b1  | b2  | ... |
|-----------------|-----|-----|-----|
| A               | A1  | A2  |     |
| B               | B1  | ... |     |
| ...             | ... |     |     |

## Constraints

- Constraint 1
- Constraint 2
- ...

## Test Values and Example I/O

Criteria Used: [Define your chosen criteria here]

Note: You can write some explanation about how you choose your criteria to help
you during demonstration.

| Test Value | Example Input | Expected Output |
|------------|---------------|-----------------|
| A1B1...    | Input 1       | Output 1        |
| A1B2...    | Input 2       | ...             |
| ...        | ...           | ...             |

Tips: If you write using Markdown and want to export the document as PDF file, you can use pandoc to export text file written in Markdown into a PDF.


Last update: 2023-11-15 14:05:09
Created: 2023-11-15 14:05:09