diff --git a/docs/2023/exercise2.md b/docs/2023/exercise2.md new file mode 100644 index 0000000000000000000000000000000000000000..5b19581eddd533b6df07c743b24afcafa323f8a2 --- /dev/null +++ b/docs/2023/exercise2.md @@ -0,0 +1,110 @@ +# Exercise 2: Input Domain Modeling + +You are asked to design an input domain model (IDM) for testing the [Sitodo PMPL][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](#appendix-1-markdown-template) or [Microsoft Word](https://pmpl.cs.ui.ac.id/2021/resources/exercise2-template.docx). + +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](https://pmpl.cs.ui.ac.id/2021/resources/exercise2-idm_example.pdf) if you require a reference on how to create an IDM. + +## Tasks + +1. [ ] Fork the [Sitodo PMPL][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 + +- [Ch 6. Input Space Partitioning slide at Paul Amman's Introduction to Software Testing book website](https://cs.gmu.edu/~offutt/softwaretest/powerpoint/Ch06-ISP.pptx) +- [6.005 — Software Construction on MIT OpenCourseWare | Reading 3: Testing](https://ocw.mit.edu/ans7870/6/6.005/s16/classes/03-testing/index.html) + +## Appendix 1: Markdown Template + +You can use the following Markdown template to document the IDM in your +`exercise2.md` file. + +```markdown +# 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`](https://pandoc.org/) to export text file written in +> Markdown into a PDF. + +[Sitodo PMPL]: https://gitlab.cs.ui.ac.id/pmpl/2023/input-domain-modeling-exercise diff --git a/mkdocs.yml b/mkdocs.yml index 2f8d608bdcac7018d5dcd656cb76fe42b80d4c12..c00cfb298f5f22d3dc4b9b94fb146170a9c2137d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -59,6 +59,7 @@ nav: - Docker Installation: workshops/prep.md - Problem Set: - (2023) Exercise 1 - Automated QA: 2023/exercise1.md + - (2023) Exercise 2 - Input Domain Modeling: 2023/exercise2.md - (2022) Exercise 1 - Automated QA: 2022/exercise1.md - (2022) Exercise 2 - Input Domain Modeling: 2022/exercise2.md - (2022) Exercise 3 - Behavior Driven Development: 2022/exercise3.md