辅导案例-CO3095 /

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
CO3095 / CO7095 Coursework Resit
Jose´ Miguel Rojas
July 23, 2020
1 Disclaimer on Plagiarism and Collusion
This is an individual piece of coursework that is assessed. Plagiarism, including collusion, is pe-
nalised. For further information check the section Referencing and Academic Integrity in your Student
Handbook (https://campus.cs.le.ac.uk/ForStudents/).
By submitting your solution, you are stating that this solution is the result of your sole individ-
ual work and that you are aware of the consequences of incurring in plagiarism and/or collusion, as
summarised in the Declaration of Academic Integrity (for MSc Students: https://goo.gl/pdBicw) and
Declaration of Academic Honesty (for all other students: https://campus.cs.le.ac.uk/ForStudents/
plagiarism/DoAIF.pdf) that you will have already signed.
2 General remarks
• This assignment must be submitted via Blackboard by Monday 24 August 16:59:59 UK time.
• Learning outcomes being assessed: Students will be able to choose appropriate strategies for soft-
ware testing and validation, and discuss how to implement them.
• The solution to the assignment must be submitted as a single ZIP file containing three files:
– A PDF file with two sections for task 1 and task 2. Use font size 12, line spacing 1.5, and
maximum page count 10.
– A Java file named SortedIntegerList.java which is a copy of the given SortedIntegerList.java
but includes comments in each method corresponding to a mutant.
– A Java file named SortedIntegerListTest.java containing all your JUnit test suite.
3 Tasks
Task 1
You are working in the software development division of the major investment bank. You have taken on
the management of a new project that is critical to the bank’s business strategy. You have developed an
initial project plan:
Activity Description Dependency Duration (days)
A Enterprise Analysis — 10
B Requirements Elicitation — 10
C Requirements Analysis and Prioritisation A, B 15
D System Architecture C 5
E Design D 8
F Setup Continuous Integration — 3
G Prototype Development D, E, F 30
H Unit and System Testing G 15
I Acceptance Testing H 5
1
Sub-tasks:
1. Create a network diagram using activity on node notation, capturing the dependencies between
the identified activities.
2. Identify the critical path for the network diagram.
3. Compute the slack for all activities and briefly discuss the meaning of the computations.
4. Build a Gantt chart for your project making the necessary assumptions about start date and
working days. Indicate clearly when the project is expected to start and finish.
5. During the project it turns out that the activity F (Setup Continuous Integration) is delayed
because the servers needed for this task did not arrive until 10 days into the project. Discuss the
impact of this on the project plan and the project.
Task 2
Let us suppose you have a Java method with the following signature, which takes an array of numbers
of type int as input and returns a sorted version of this input array:
public static int[] sort(int[] numbers)
You task is to use the Category Partition Method to construct test sets for the sort function,
identifying at least five categories for the variable numbers. You must:
1. Present the categories, providing a justification for each of them.
2. Identify reasonable constraints to link categories if/where appropriate.
3. Calculate the number of possible test frames, and discuss the impact of any constraints.
4. Provide a test case, that is, an example set of inputs and expected outputs conforming to a
particular test frame.
Task 3
Given the following Java class named SortedIntegerList (also available to download as a Java file).
1. Write a JUnit test suite that achieves 100% branch coverage in the SortedIntegerList class.
2. Identify one mutant in each method in the SortedIntegerList class (mark them as comments in
the code) that would be killed by one of your tests (deletion of lines of code is not allowed). A test
needs to fail if you apply the mutation.
public class SortedIntegerList {
private Node first = null;
public boolean isEmpty() {
return (first == null);
}
public int size() {
Node curr = first;
int n = 0;
while (curr != null) {
n++;
curr = curr.next;
}
return n;
}
2
public Integer getFirst() {
if (first == null)
return null;
else
return first.data;
}
public Integer getLast() {
Node curr = first;
Node foll = first;
while (foll != null) {
curr = foll;
foll = foll.next;
}
if (curr != null)
return curr.data;
else
return null;
}
public Integer get(int index) {
Node curr = first;
int i = 0;
while (curr != null && i < index) {
curr = curr.next;
i++;
}
if (curr != null && i == index)
return curr.data;
else
throw new IllegalArgumentException("incorrect index " + index);
}
public void insert(Integer data) {
Node curr, foll;
if ((first == null) || (data <= first.data))
first = new Node(data, first); // Insert at the beginning
else {
curr = first;
foll = first.next;
while ((foll != null) && (foll.data < data)) {
curr = foll;
foll = foll.next;
}
curr.next = new Node(data, foll);
}
}
class Node {
Integer data;
Node next;
public Node(Integer data, Node next) {
this.data = data;
this.next = next;
}
}
}
3
4 Marking Criteria
All the tasks in the assignment bear equal weight.
Distinction
• The planning task has been carefully developed and all the artefacts produced are mostly correct
(network diagram, critical path, gantt diagram).
• The categories are carefully thought out and well justified, and identified constraints between
categories are formulated in a sensible way without raising the possibility of excluding valid test
cases.
• The number of resulting test frames has been correctly worked out and the process is clear.
• The test case is clearly presented, along with an anticipated output. If the output cannot be
predicted (e.g., because we do not have access to implementation details), a well-reasoned guess is
provided.
• The set of test cases in Task 3 achieves full branch coverage with a reasonably small number of
test cases which are well described.
• One mutant is identified for each method which makes a test case fail.
Merit
• The planning task has been carefully developed and the artefacts produced are mostly correct
(network diagram, critical path, gantt diagram).
• The categories are carefully thought out, and well justified.
• The number of resulting test frames has been correctly worked out for the categories.
• A test case is presented along with an anticipated output. If the output cannot be predicted (e.g.,
because we do not have access to implementation details), a well-reasoned guess is provided.
• The set of test cases comes close to achieving full branch coverage.
• Mutants have been identified for most methods in the class.
Pass
• The planning task has been attempted and some of the artefacts produced are correct (network
diagram, critical path, gantt diagram).
• Some categories were identified which make some sense.
• The number of resulting test frames has been worked out but the process is unclear.
• A test case is presented but the relation input-output is not clear. If the output cannot be predicted
(because it relies on logic that we do not have access to) - a well-reasoned guess is provided.
• The set of test cases achieves at least 50% branch coverage and some of them are well described.
• Only a small portion of mutants were identified.
Fail
• The planning task has been attempted but all the artefacts produced are flawed (network diagram,
critical path, gantt diagram).
• There has been a serious misunderstanding of the category partition method. The categories do
not make sense, and most justifications are fundamentally flawed.
• The set of test cases achieves less than 50% branch coverage.
• Most mutants are missing or do not make much sense.
4
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468