联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2025-05-15 09:05

CHC4010 DevOps - Coursework Assignment

2024-2025

Learning Outcomes

Students will be able to:

- analyze Java source code using an IDE

- write JavaDoc description clarifying the input, output, and the functionality of specified

methods

- identify and fix bugs in the program utilizing debugger and code analysis tools

- design and implement automated tests for specified methods using JUnit5

- use Git to track progress and manage changes

Introduction

For this coursework you will be doing work understanding, debugging, documenting, and

testing a program that has been provided to you, and track your progress using Git while doing

so.

You have been provided with the java source code that implements a game of Connect Four,

also called Plot Four. (The game is described in more detail at the end of this document.)

Unfortunately, a rather strange and oddly specific glitch has carried the names of all the

variables and functions in the program away – literally.

Use a Java IDE to analyse the program with the debugger and code analysis tools, and work out

what each variable, parameter, and method does. You should also find and fix the bugs in the

program and write automated tests for relevant methods with JUnit5. All your work should be

tracked with a version control tool.

You must submit your work before 23:59 on Friday of week 11.

Part of the coursework include a quiz related to the program, and will be taken in class on week

12. Note that you should complete tracing and learning about the program before submitting it

at the end of week 11, and doing the quiz on week 12.

Feedback will be provided online once the work has been completed. You may also ask for

feedback from your class tutor in any module session, although tutors will not directly tell you

the answers to questions.

This is individual work and is subject to the University’s regulations on assessment. Students

who plagiarize work from other students, the Internet, or any other source, will be subject to

the Academic Conduct Process. Work submitted late without an appropriate Mitigating

Circumstances claim or Equality Memo will not be marked. Posting parts of the source code, or

of your answer, on the Internet (to solicit answers or for any other reason) is not permitted and

will be treated as an attempt to cheat or facilitate others cheating.

Tasks

• Change the name of the variables, parameters and methods to more meaningful names

• Add JavaDoc description to each method, describing the input, output of the functions

and what they do

• Find and fix the bugs

• Write automated tests for methods honeysuckleRose(), cJamBlues(),

onTheSunnySideOfTheStreet(), and mackTheKnife()with the testing

library JUnit 5.

• Use Git to track your progress and make different commits for the four tasks mentioned

above with clear commit messages. Your local Git repository should be synced with a

remote repository on gitee.com.

• In the quiz, you will answer questions about variable and method naming,

documentation, bug fixing, and testing. A printout of the original java source code will

be supplied.

Once you have finished refactoring the program, you must submit ONLY the source code

file and the test file on the student website before the deadline.

Marking Scheme

The coursework accounts for 50% of your total score for this module, divided into 3 parts:

- Submitted code: 10%

▪ Variable, method, and parameter naming - 3%

▪ Javadoc - 2%

▪ Bug fixing - 2%

▪ Testing - 3%

- Git repository: 10%

▪ Commit messages - 3%

▪ Isolation of issues - 3%

▪ Clean Git history - 2%

▪ Organized and methodical work - 2%

- Quiz: 30%

▪ Variable, method, and parameter naming - 16%

▪ Testing - 10%

▪ Bug fixing - 4%

More details are included in the rubrics.

Tips

• You must use IntelliJ IDEA for this exercise.

• The file is provided as a bare Java source file. You should create a Project in an IDE and

then load the file into it. Do not just open the file raw, as it will not be associated with a

JDK and analysis tools will not be available.

• You should rename the variables in the source code first as it will make the work much

easier. Start by identifying the obvious variables based on the user prompts and the

string outputs, rename these, and then see how they are used elsewhere in the

program. Do make notes of what you have renamed each variable as the quiz will ask

you about this.

• The program may use some Java constructions you have not seen before. Tracing the

code should help you learn what these do.

Connect Four

Connect Four is a game in which the players choose a color and then take turns dropping

colored tokens into a six-row, seven-column vertically suspended grid. The pieces fall straight

down, occupying the lowest available space within the column. The objective of the game is to

be the first to form a horizontal, vertical, or diagonal line of four of one's own tokens.

You can play this game here.

Our program represents the grid of the game with a 6 by 7 matrix of square-shaped characters,

with red and blue circles representing the tokens of two players, who take turns selecting the

column to drop their next token in. For example, when it’s the turn for the red player to play

and they entered “2”, a red token will be dropped into the second column, on top of all the

tokens that are already there, or at the bottom of the column if it’s previously empty. When 4

red tokens appear consecutively on a vertical, horizontal, or diagonal line, the red player wins

the game; likewise, when 4 blue tokens appear consecutively on a vertical, horizontal, or

diagonal line, the blue player wins. If all the spots are filled without any winner, a tie is reached.


相关文章

【上一篇】:到头了
【下一篇】:没有了

版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp