Adv Software Eng: HW1 Fall 2020
Home work in this course is done individually, without help from others. The due date is announced on the course home page.
In this HW1, we are focused on the (i) use of Assertions, (ii) Design by Contract (DbC), and (iii) fluency in C++ and Java/Kotlin. We will have a look at "proper OOP" later on in this course, but for now go with what you learned in your earlier courses. We are also assuming that we are "done" with requirements and specs.
The numbers in parens indicate relative importance of subtopics. They do not add upto a 100.
1 Wiggly Worms in C++
[45 points] [C++] The single file worms.cpp colorized | worms.cpp plain implements a grass roots game example of wiggly worms. See the reference listed below.
- (40) Revise it (or write afresh) so that it is in "proper" OOP form. Describe the end result and the changes made in a brief tech (about 2 pages) report.
- (10) Write one or two paragraphs reporting on proper OOP form as you applied it in the code, how you discovered and revised the classes, and on your experince with the tools you used to carry out this assignment.
- (60) Write entry- and exit-assertions for all the methods, and class
invariants. You may ignore assertions relating to
ncurses
. - (60) There is a design behind this code. In this HW, document this using DbC.
- (20) The design and code as-given do not "really" do anything about the z-axis. Suggest ideas and implement.
- (00) It probably has bugs. Feel free to ignore its bugs (that is, you are not expected to fix bugs). If you can, identify them!
1.1 Bonus
- [25 points Bonus] The worms program given above did not use threads. Use threads to improve the "look and feel" and revise your answers to 1.1 through 1.5.
- [25 points Bonus] The worms program given above probably has bugs. Fix it and guarantee that it no longer has bugs. How will you convince a skeptic?
- [Bonus points help only when you are just below a grading curve for a given letter. At the discretion of your instructor.]
2 Condense the Numerical Ranges [CNR]
[45 points] [In Java8+, or Kotlin]
- (60) Two designs were presented to the CNR Problem (see the Ref below). Neither designs discussed in the Ref did not use DbC. Redo the design descriptions based on DbC.
- (50) Implement these in Java or Kotlin in "proper" OOP form. Later, we will use this code during discussions/ HW#2 of Testing, Debugging, etc.
- (50) Correctness must be the focus. Efficiency is important, but a distant secondary goal. Include supporting discussion.
- (30) Write entry- and exit-assertions for all the methods, longer than 10 lines, and all class invariants. For every loop, include a strong (strongest?) loop invariant.
- (20) Include test results for at least 100 examples. Explain how you constructed these examples. Chronologically, in the lectures, we are yet to cover testing. [You are welcome to share the test input/output pairs, but not results.]
- (10) Must build cleanly with the latest Java8+ or Kotlin. Use a build system of your choice: ant, maven or gradle.
- (10) Write one or two paragraphs reporting on proper OOP form as you applied it in the code, how you discovered and revised the classes, and on your experience with the tools you used to carry out this assignment.
3 Journal
- [10 Easy-to-Earn Points] Please maintain a journal for this homework. Submit a summary.
4 Turn In
- Follow all ethical/ scholary traditions of attribution.
- Include screenshots, particularly for the Worms program. Other than the source code files, put everything else together and produce one PDF file.
- The file named
hw1.tar.bzip2
should be a compressed tar ball of all the files related to this homework. Include the revised/ original source code files so that everything builds cleanly. I expect to see sub-directories for each problem. I expect to be able to build all the programs by invokingmake
, …, orgradlew build
at the top level. - Submit on Pilot.
5 References
- Prabhaker Mateti, Lecture Notes on Design by Contract
- Prabhaker Mateti, Lecture Notes on Wiggly Worms
- Prabhaker Mateti, Lecture Notes on Condense Num Ranges