Work Hours
Everyday: 北京时间8:00 - 23:59
2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam
Final Exam Started: Nov 23 at 17:00 Quiz Instructions Question 1 20 pts Consider the following code snippet. —————————– build.gradle —————————————– plugins { id ‘java’ id ‘application’ } repositories { jcenter() } dependencies { implementation ‘com.google.guava:guava:29.0-jre’ testImplementation ‘org.junit.jupiter:junit-jupiter-api:5.6.2’ testRuntimeOnly ‘org.junit.jupiter:junit-jupiter-engine:5.6.2’ } test { useJUnitPlatform() } application { mainClassName = ‘GreetingApp’ } —————————– GreetingApp.java —————————————– package greet; import com.google.common.base.Joiner; import com.google.common.collect.Lists; import java.util.List; 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 2/14 public class GreetingApp { public static void main(String[] args) { List newList = Lists.newArrayList(“Hi”,”Everyone”); String result = Joiner.on(” “).join(newList); System.out.println(result); } } Imagine that you are working in a development team that uses CI/CD practices. The team uses the following above code snippets in their CI/CD server. Examine the code snippets and answer the following questions. 1. Your project builds successfully every time “gradle build” is executed, but it shows an error when you run “gradle run” command. Explain what caused the error from running “gradle run” command. Explain how how to fix that error. [4 marks] 2. Assuming that the error described in previous part (question part 1) is fixed, one of your team members wants to generate the jar file from your project by running command “gradle clean build” to build the project and then “gradle jar” to generate the jar file. Explain why it is not best recommended to perform this task in this way. [4 marks] 3. After checking the jar file, your team member found out that the jar file cannot be run successfully due to an error. What changes should be made in build.gradle and/or GreetingApp.java to make sure that the jar file can be run successfully. [4 marks] 4. Discuss the steps required in Jenkins to make the jar file accessible/can be downloaded in Jenkins for every successful build. [4 marks] 5. After performing the steps in the previous part (question part 4), discuss any CI practice that can be satisfied after making the jar file accessible in Jenkins. [4 marks] Your answers must follow to the question’s number sequence listed above. You commands/code must execute without any errors and produce the correct output as specified in each of the above tasks. Edit View Insert Format Tools Table 12pt Paragraph 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 3/14 p 0 words Question 2 5 pts Consider a web application called StockTrain 3.8.2 which is being maintained by a software development team. The team used a software package called PredictsX 2.0.1 in the the development of StockTrain 3.8.2 Which versions of PredictsX software package can be used safely in the future releases StockTrain? Explain Why? Edit View Insert Format Tools Table 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 4/14 p 0 words Question 3 19 pts Assume you work on a group repository called “GroupProject” with a remote repository called “origin”. The primary branch is named “master” branch and this branch has been initialised and consists of several commits. 1. Assume that you want to work on your own branch called “feature-multiply” that is based on the current “main” branch, write Git command(s) to create and move the HEAD pointer to your new branch. [2 marks] 12pt Paragraph 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 5/14 2. Assume that you have modified “app/src/main/java/Calculator/Calc.java” file by adding a new method called “multiply()”, write Git command(s) to commit your changes with a descriptive message. [3 marks] 3. Write Git command(s) to switch back into the primary branch and obtain all updates from the remote repository. [3 marks] 4. Write Git command(s) to apply your previous changes from your own branch to the primary branch. [3 marks] 5. Assume that when you ran the previous command(s), you found out that someone else has made another commit to the primary branch. The console output prints “CONFLICT (content): Merge conflict in app/src/main/java/Calculator/Calc.java”. Write and update “Calc.java” to fix the merge conflict, given the current content of the file is as listed below. [4 marks] package Calculator; public class Calc { <<<<<<< HEAD public int divide(int a, int b) { return a / b; ======= public int multiply(int x, int y) { return x * y; >>>>>>> feature-multiply } } 6. Write Git command(s) to continue the process in part (4) after updating the previous file. [4 marks] Your answers must follow to the question’s number sequence listed above. You commands/code must execute without any errors and produce the correct output as specified in each of the above tasks. Edit View Insert Format Tools Table 12pt Paragraph 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 6/14 p 0 words Question 4 13 pts Consider the code snippet “build.gradle” and answer the following questions. —————————————– build.gradle ——————————————————- plugins { id ‘application’ id ‘jacoco’ } repositories { mavenCentral() } dependencies { testImplementation ‘org.junit.jupiter:junit-jupiter:5.7.2’ implementation ‘com.google.guava:guava:30.1.1-jre’ } application { 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 7/14 mainClass = ‘gradletask.App’ } tasks.named(‘test’) { useJUnitPlatform() } 1. Modify the “gradle” file so that: (a) Gradle will always run task “clean” first when “gradle build” command is executed. [3 marks] (b) Gradle will run task “build” and then task “run” when “gradle trun” command is executed. [4 marks] 2. Write Gradle command(s) to print all Gradle tasks that includes the new tasks added in question part (a). [3 marks] 3. Write Gradle command(s) to build the Gradle project but excluding task “assemble”. [3 marks] Your answers must follow the question’s number sequence listed above. Your commands/code must execute without any errors and produce the correct output as specified in each of the above tasks. Edit View Insert Format Tools Table 12pt Paragraph 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 8/14 p 0 words Question 5 10 pts Imagine a SCRUM team working on the development of a Ticket Booking Management software. The projects is estimated to run for ten Sprints each of which is two weeks. Halfway through Sprint 3, the scrum master Rob thinks that there is a lack of understanding on one of the requirements that constitutes of 3 user stories in the product backlog. Rob is convinced that this inconsistency is a big problem. Hence, he decides to clarify this with the client. He then propagates this to the development team. 1. According to Scrum method, is there any issue(s) with the way that Rob handled the situation? Discuss your answer. Explain how to rectify the issue(s) if identified any (you also should explain your answer if do not identify any issue(s). [5 marks] 2. The next day, during the daily Scrum meeting, Jenny shared the details of important database configuration issue she had. John had to deal with the same issue during the development of a user story. He asked Jenny about further details and how to resolve it. Jenny and John discussed further details and how to resolve the issue which helped the whole them to move forward with their development. Discuss whether this practice was acceptable or not and why according to Scrum method. [5 marks] 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 9/14 p 0 words Question 6 5 pts Consider a software development company which is working on the development of an integrated control software for a national shoe manufacturer. The software will collect sales information daily from shoe stores nationwide. The information will be used by the accounting, shipping, and ordering teams to control all of the functions of this large enterprise. A quality assurance software engineer suspects that the auditing functions of the software are not sufficiently tested, although they have passed all its Edit View Insert Format Tools Table 12pt Paragraph 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 10/14 contracted test suites. He was pressured by his employer to sign off on the software. His employer says they will go out of business if they do not deliver the software on time. He did sign off. Discuss the action that the software engineer has taken in response to the situation. Question 7 6 pts 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 11/14 You are managing a development team that is building software for determining the best location-based services for mobile users called LocationX. The company’s management team informed you they would like to achieve the highest levels of adoption in terms of making LocationX software used by many software applications. They also mentioned that they are not concerned about sharing any potential modifications that might be made by the adopters of the source code of LocationX. Which software license would suggest to the company’s management? Discuss your answer with examples. 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 12/14 Question 8 10 pts In the group project assignment 2, you have collaboratively worked as a group on developing a movie ticket booking software. Your team should use agile development tools and practices as well as follow the Scrum method. Each team member should have implemented multiple user stories/features. Using an example of a user story/feature you have implemented in the project, discuss how CI works from the time you start working on the user story/feature until the feature is implemented and integrated into the working version of the next increment keeping in mind the teamwork. Note that you need to discuss the details of the steps involved conceptually but without the need to write a script or source code. Use bullet points. [8 marks] 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 13/14 Question 9 12 pts A software development team is working on the development of a software application that controls the timetable of trains. A software engineer implemented the following method which is to be used by several classes. public static int getNumDaysInMonth (int month, int year) throws MonthOutOfBounds, YearOutOfBounds { int numDays; if (year < 1) { throw new YearOutOfBounds (year); } if (month == 1 || month == 3 || month == 5 || month == 7 || month == 10 || month == 12) { numDays = 31; } else if (month == 4 || month == 6 || month == 9 || month == 11) { numDays = 30; } else if (month == 2) { if (year%4 == 0) { numDays = 29; } else { numDays = 28; } } else { throw new MonthOutOfBounds(month); } return numDays; } A software testing engineer has defined the following set of test cases to test the above code. (month = 1, year = 0), (month = 12, year = 1975), (month = 2, year = 2020), (month = 4, year = 1923), (month = 2, year = 1977), (month = 13, year = 1950), (month = -6, year = 1900) Discuss the quality of the above test cases in terms of the likelihood to discover bugs or any undesired behavior. 2021/11/23 下午2:01 Quiz: SOFT2412_COMP9412 Final Exam https://canvas.sydney.edu.au/courses/37981/quizzes/164719/take 14/14 Not saved Submit Quiz