IIT Assignment 2 - MM
IIT Assignment 2 - MM
Instructions
Assignment 2 is about testing your knowledge and skills in writing a Python-based GUI application and
producing a minimum set of tests, to assess a piece of code according to certain business rules. As
such, the assignment requires you to integrate and synthesise what you have learnt so far in this unit,
in order to design and create a proper working solution, and to perform a basic software testing task.
This assessment contributes towards 20% of the total marks allocated in the unit. It has two general
questions and 110 marks that are distributed as follows:
1) Software Testing (25 marks) and
2) Python-based GUI (85 marks)
Submission
Question 1:
Needs to be completed in any standard text editor or spreadsheet (such as Microsoft Word or Excel.
See example included in this assignment).
Question 2:
Requires you to submit a text document (for answering parts 1 and 2), and a Python module (for
answering parts 3 and 4).
Once finished, compress (zip) all your files with the following format: u123456_Assignment_2.zip.
Upload your file in Canvas using the submission drop-box provided in module “Final Assignment”.
Note that only .zip files are allowed to be submitted.
THREE SUBMISSIONS ARE ALLOWED. ONLY THE LAST SUBMISSION WILL BE GRADED. SUBMITING
THE CORRECT FILES IS YOUR RESPONSIBILITY!
1|Page
UNIVERSITY OF CANBERRA
INTRODUCTION TO INFORMATION TECHNOLOGY (4478/8936)
ASSIGNMENT 2 – SEMESTER 1 - 2023
You are tasked to work out the required tests needed to assess the performance of a function written
in Python coding language. The description of the problem, business rules, variables and variable types
are as follows:
Referendum
A. Statement
To pass a referendum, a motion has to get more than half of the total votes and at least two-third of
the states. A state is in favour if more than half of the voters are in favour.
For this application, you have to set values for stateVotesFor and stateVotesAgainst, and expected
values for outcome().
To assist you in your task, stateVotesFor and stateVotesAgainst should be comma separated lists of
whole numbers (that is, integers). Note that outcome() refers to passing or not the referendum.
The two lists should be the same length. Also, outcome() should be Yes or No.
Do not test for invalid data. Assume that the user enters valid data types as arguments in the function.
Remember:
1) Add a proper plain-English written description for each test.
2) No numbers are allowed as part of the description.
3) Include all the test cases as described during the lectures and tutorials.
4) All functions to test are designed such that they do not need more than 4 tests. That is, you
only have up to 4 tests available to assess all boundaries and partitions.
B. Marks allocation:
• All boundaries are tested. [8 marks]
• All partitions are tested using values nearby boundaries. [8 marks]
• Proper descriptions are given for every test. [9 marks]
Note: No more than 6 tests are allowed. Extra tests will not be considered for marking purposes.
2|Page
UNIVERSITY OF CANBERRA
INTRODUCTION TO INFORMATION TECHNOLOGY (4478/8936)
ASSIGNMENT 2 – SEMESTER 1 - 2023
A. Statement
The Army will only enlist people between the ages of 18 and 40 inclusive
3|Page
UNIVERSITY OF CANBERRA
INTRODUCTION TO INFORMATION TECHNOLOGY (4478/8936)
ASSIGNMENT 2 – SEMESTER 1 - 2023
A. Background
Our astronauts are about to leave for a trip to outer space. They may be visiting the Moon, Mercury,
Venus, Mars or one of the larger moons of Jupiter (IO, Europa, Ganymede or Callisto). Each astronaut
has a mass allowance in kg for items that they can take along the trip, including tools and personal
items. The amount they are allowed depends on their job description as follows:
B. Business Rules
You need to calculate how much mass each astronaut has left over for personal items, the total
available mass and the average available personal mass allowance across all six astronauts. You need
to also calculate the weight of the average available personal mass allowance on the celestial body
the astronauts are travelling to. Assume there are three crew astronauts and three mission specialists
(be sure to clearly state your assumptions).
Below is the list that contains the names of the celestial bodies that our astronauts may travel to and
their Mass multipliers. This list must be stored using an appropriate data structure.
Do not hard-code this table.
4|Page
UNIVERSITY OF CANBERRA
INTRODUCTION TO INFORMATION TECHNOLOGY (4478/8936)
ASSIGNMENT 2 – SEMESTER 1 - 2023
The user also needs to decide which celestial body the astronauts are travelling to, alongside their
mass. The code will display a list of celestial bodies that are possible destinations along with their mass
multipliers. The code also needs to display the weight allowances for the two different types of
astronauts.
Below is an example of a GUI (you do not have to do yours like this one).
Remember:
• You have a great degree of freedom in what GUI elements you choose and how you would
like to design the layout of your GUI.
• What matters is the functionality of the design, and that the user can input the required data
in a sensible fashion.
• Some elements are compulsory, as we need to assess your understanding of performing a
suitable GUI (see marks distribution).
C. Marks distribution
5|Page
UNIVERSITY OF CANBERRA
INTRODUCTION TO INFORMATION TECHNOLOGY (4478/8936)
ASSIGNMENT 2 – SEMESTER 1 - 2023
• An explanation (through a comment in the same code) is given about the exception
implemented (for instance, # ‘KeyError” used as an unacceptable string could be entered by
the user) [10 marks]
• Graphical User Interface (GUI) [TOTAL 70 MARKS]
Your GUI application must allow a user to input various data elements and must:
1. Use the Grid element [5 marks]
2. Add Label elements throughout your GUI. [5 marks]
3. Use the Background Colour property. [5 marks]
4. Allow a user to select choices from an either list box, drop-down menu, or scroll-down menu
element. [10 marks]
5. Allow a user to input the data using an entry widget. [10 marks]
6. Output data using an entry widget. [5 marks]
7. Allow a user to click on a Calculate button that triggers any calculation. [5 marks]
8. Allow a user to press an Exit or Quit button to properly close the program. [5 marks]
9. GUI Design. Is it simple to use and easy to understand? [5 marks]
10. Program is written using well-defined functions. [5 marks]
11. Program code layout. Separate blocks of code by a blank line. [2 marks]
12. The program must have an introduction (about the module, not the topic). Check style against
the Python style guide attached below. [2 marks]
13. Business rules are met. That is, your code solves the problem you are proposing (or at least
contributes to its solution). [6 marks]
6|Page