# SWE30009 S2-2025 - Assignment 2 briefing

**Channel:** Colin Tan
**Source:** https://www.youtube.com/watch?v=edvwr_9N1Dk
**Transcript page:** https://www.withtranscript.ai/video/edvwr_9N1Dk

## Chapters

- 0:00 — Assignment 2 Overview and Program Scope
- 3:38 — Designing Test Cases and Mutants
- 7:51 — Building Metamorphic Test Groups
- 14:29 — Evaluating Mr.2 and Reporting Results
- 19:14 — Formatting Rules and Final Marking Criteria

## Transcript

**[0:00]:** Hi students. Welcome to the briefing for Assignment 2. As usual, here is the plagiarism reminder, so just be aware about it. Now let me brief you for the Assignment 2 task description.

**[0:17]:** Here it says use either C, C or C programming to develop a simplified version of your Assignment 1 program, focusing exclusively on Use Case 1 and Use Case 2.

**[0:33]:** So here is just a screenshot of the program from Assignment 1, which is calculating the customer's bill for the dessert show. Now you can see in this screenshot here is only showing use case one and two, because that is what it is in this assignment. You only need to write the program for these two use case only.

**[1:00]:** Basically, the program should sum up the prices, apply the tax, and that's it. Okay?

**[1:07]:** No need other types of use case where there is those like loyalty, discount and also take away charges. All these, those are more complex, okay? Conditions which we will not try to do. Okay, because this assignment focus on using mutation testing to test the effectiveness of some metamorphic relation. So this is what you should do.

**[1:37]:** Implement the program. Later I will show you what is the console output that you should be showing. Okay, so here are some more details. Okay, this simplified program, we will refer it as program P. It must be implemented as a callable function from the main function. While the test cases are defined in the main function.

**[2:07]:** This is exactly what you did in tutorial six, if you forgot. Or is this. You can refer to the recording of my Tuesday 10am session, Tutorial 6 in Canvas, you should be able to see what does this mean. Okay, so implement a particular program as a call level function. And then in the main function, you put the test case there.

**[2:36]:** Okay? And you want to run that program, you just call it from the main function and give it the test cases. Right? Now you should include the full source code for this program P in the appendix section of your report, not in the main body. Well, full program may have a lot of cost.

**[2:58]:** Okay, so if you put it in the main body of your report, it will affect my reading. So anything that is very long, you will usually put at the end of the report in the appendix section. Okay, so next instruction, after implementing this whole program, you also need to design your test suite. Okay, so here we just need you to have five test cases, which is SI1 to SI5. Well, in your tutorial six, if I'm not mistaken, it's also five test case, right? SI1 to SI5, so very similar.

**[3:38]:** So in each SI you have a list of value representing the price of the order item. So each SI contains A list of values. Then you limit each list to a maximum of 10 values. Because I don't want you to put a list that is too long, like 20, 20 prices or 30 prices. No, keep it short.

**[4:00]:** Not more than 10 values. Actually, you can have some of the test case. More values, less value, but all of them don't put more than 10 values. Okay, not more than 10 values.

**[4:17]:** So the next instruction, after having all these test cases. Actually, when you are creating the test case, you should have some consideration already. For example, we have learned about test case selection strategy in some of the weeks. I think in two weeks, I think it's week three or week four. Then refer to the lecture we talk about test case selection strategy. How should you start? By selecting your source test cases. You may be looking at the input some information you know and do not know. Looking at the output from some information that you know and do not know. What considerations that you need to have when you select the test case.

**[5:02]:** Okay, so that those will give you quite a lot of idea. Can you. So it says your justification must be primarily, primarily based on the test case selection strategies covered in your lecture and tutorial. Right. So make use of that.

**[5:17]:** Tell me from which chapter, which lecture you, what is the name of the strategy? Okay, justify it in not more than 350 words. This should be approximately around half a page like that, around. So not more than 350 words. You can count the number of words in Microsoft Word.

**[5:37]:** For example, if, let's say you highlight a certain text here, okay, you can see on the bottom here, it says 41 words, the part that I've highlighted. So whatever you written, you can highlight it and you check your number of words. Is it over 350? Not more than that. Okay, so next instruction.

**[5:56]:** Now you have your program, you have your test case. So it's time to test your program. So this program here, you test it with your 5 test case. Manually check them, ensure that they calculate correctly. Okay, which means can sum up all the prices. Apply the text. Okay, so this is program p. Now instruction 5. After manually verifying that the program P is working correctly, I want you to copy paste the function of program P. Remember, program P is a call level function separate from the main function. Copy that function of program P. Copy, make a few copies of it and create three mutants. You have learned how to create mutants, right? By mutating certain statements in that function. Okay, so specifically, only one mutation. That is what we did in Tutorial 6 as well. Only one small mutation. Okay, then for each mutant clearly indicate which statement in the original program P were modified and describe the specific change made.

**[7:01]:** You can when you mutate the statement, of course you it's a good practice to put a comment in the source code there saying this line has been modified like change in what change in the relational operator, change in variable names or whatever those are you should put there as well. Then in your report you can like take screenshot of the of that function at that place where mutation happen and you can like circle it, you can highlight it in your report. These are ways for you to make it clearer to me, right? So you can do so. Okay. Clearly indicate which statements in the program original program view mutated and describe the change that you made. Okay, you can explain a bit the change.

**[7:51]:** Now after you have these three mutants, the next task is to use mutation testing to evaluate the effectiveness of Mr.1 and Mr.2 specified below, which relates to use case 1 and use case 2. If you see these two Mr. So one of it is adding a new element, which means it's like use case one, right? Customer order different items can add one more items, right? So all the different items, this is what Mr.1 is doing. Add case a new element in SI and then there's the output prediction there. For Mr.2 it is relates to the 50% discount. That's why multiplying every element SI by 0.5 that's why it says by use case to press for all items may be half.

**[8:37]:** Okay, so two misses and we will use mutation testing to evaluate how good, how effective is both of both these Mr. In detecting those three mutants.

**[8:53]:** Okay? So for each Mr. Construct the metamorphic test group from your source test case. You already have SI1 to SI5 that you created earlier here, right? So based on the mister, the mister first part, the if part is telling you how to modify, right? Create your fi. So follow your modification there. So create your metamorphic test group. Okay, that's what you did in tutorial 6, right? Using the Mr. To generate the corresponding follow up. Input fi1 to fi5 and present your result in a table of violations and compute the effectiveness of Mr.1 and Mr.2.

**[9:38]:** The table must clearly display the values within each MTG and follow the format provided. Please see next page. Now you see here. Okay, so this is a table that you can just create on your own in your Microsoft Word. There follow exactly like this.

**[9:57]:** Okay, you need to follow exactly like this table and you see your MTG can be shown very clearly if you follow this format. What is your SI? Previously you create your SI1, SI2, SI3, SI4, SI5. Right? Now by following the Mr.

**[10:17]:** Modification you will have your FI here, your FI is all here. So after this you will fit all this value into your mutant. For example, mutant one is accepting a list of numbers, right? Okay, a list of value. You feed it with these SI first, okay? This SI fit to mutant one. After that you have your so, Am I right? Okay, and after that you fit your fi and you get your so, which means that when you. When. Okay, let me, let me just annotate and show to you so your, your so, okay, your son.

**[11:08]:** Okay, after you fit SI into your mutant, you get sr. And after you fit FI into mutant, you will get your fo.

**[11:19]:** So with this you can check the output relation whether they fulfill or not fulfill that output relation specified there. Let me give you curve example. For example, if, let's say your output is shown like this, mtg1si, what do you give to the mutant? And then it comes up with your so fi, what do you give to the mutant? And it comes up with your fo.

**[11:50]:** So by comparing these two values here, this value and this value, you can tell whether they match to the Mr. Here. Perhaps I should erase this part. Let me erase this.

**[12:13]:** Okay, so so by by referring to your output. Okay? When you print the output properly like MTG1, you're showing Siso, Fiso, MTG2 also showing Sis or FIFO. Then by just manually looking at the output, comparing the value of fo and so, and then you check is it fulfilling this? Is it fulfilling this?

**[12:48]:** Okay, put your so value put inside here and you and you and you do the calculation. And later you see whether it match to your fo value or not. Okay, your FO value here. So that is how you should check. You can see that you are only checking mutant.

**[13:09]:** You are not looking at program P. You know, you should never ever get your result from program P anymore. You see this table here is all mutant, mutant 1, 2, 3 and how do I put in this result? Either S or V. This should be either S, right? Or a violation. Okay, so this is all come from this output here.

**[13:37]:** I'm testing this Milton one and I have mtg 1, 2, 3, 4, 5. Within each mtg I have my so fo value which I can compare and check with this output relation. So don't get confused. Okay? No more program P at this time.

**[13:56]:** Once your mutant is created, no more program P. Once your table is filled up like all this is filled up with either satisfaction or violation, then you can Compute your effectiveness for Mr.1. It is a score between 0.0 and 1.0. Refer to the lecture or even week 6 tutorial. There is that formula to calculate this based on your result here. Okay?

**[14:26]:** So that is for Mr.1.

**[14:29]:** The same thing you can do for Mr.2. You will still using the same SI value. SI1, SI2, SI3, SI4, SI5. They are all the same as Mr.1 here.

**[14:42]:** The only difference is your FI value because of the different modifications specified by Mr.2 here, which is multiply every element in SI by 0.5 or in other words, dividing by half. Okay? Halving the value in si. Then you get your fi. So same thing, your output result. Here you refer to your output result. You can see here the sample output here. This part is for Mr.1, right? The first part here, Mr.1. Then this is also Mr.1. But now testing program M2, then testing program M3. Then after that you move to Mr.2. Mr.2 testing M1, Mr.2 testing M2, Mr.2 testing M3. Every time is the MTG. And so every instance of your result, you have these four values. Si, S O F I, F O. Your. You will. You will likely need to give me multiple screenshot. Like one screenshot. How can it be enough? Right?

**[15:51]:** There's a very long result. So make sure your screenshot screenshot it properly. Like now is. Is what now is for this one, program M1, MTG, all this and then after that, this second screenshot, third screenshot, fourth screenshot. All this put properly and with proper caption that will. That will improve. When I. When I read your report, it's very clear to me there is some marks for organizing your report as well.

**[16:21]:** Later we look at the marking criteria. Okay, so anyway, so this table is okay, right? So what you did in tutorial six, that's how you should do here. Two Mrs. Here.

**[16:36]:** Okay, so thanks. Instruction, which I already talked about it like, provide screenshot of the console output, right? Executing the MTG on each mutant. So clearly display the siso FO value just like this. Okay?

**[16:59]:** Lastly, this is the last instruction already. Provide detailed discussion on the following questions. Which Mr. Is more effective? Obviously you can look at the effectiveness score and just do the comparison. Of course, I expect you to talk a bit more like if this score higher than this score, why do you think is higher than that score?

**[17:24]:** You want to dig deeper into the Mr. Property. Okay, what property is it targeting? Why is it so effective in catching the fog in those mutants? Right? Okay, so and then the second question, which mutant contain Fog they are more difficult to detect.

**[17:49]:** Well, you may need to look at in terms of columns like this one compared to this, to this and which one is more difficult to detect and then also within this second. Mr. Also do the same and you may also do it in overall as you look it overall. Okay, like all the columns in M1, all the columns in M1, all the columns in M2, all the columns in M2, and so on. Look at the bigger picture, okay? Then you may be able to give some discussion about that.

**[18:28]:** Okay, which mutant is contain fault that are more difficult to detect. So your discussion should be written in not more than one page. Well, if you use normal font size like in this document, I'm using font size 12 times enrollment. Okay, so not more than one page. That's, that's about it. Okay. Of course your spacing, okay, you don't put 2.0 spacing right? You, you just put normal spacing. Like 1.0 is okay, okay, or 1.1 is okay, right? So approximately one page.

**[19:11]:** Okay, not more than one page.

**[19:14]:** Here are some additional notes for clarification. Program P should not prompt user for user input in the console. It should not ask user please enter the prices of the items that you bought. No, fix it. Okay, manually define in the source code where in your source code exactly in your main function. See tutorial 6. We that's what we do. In your main function we put the MTG right the SIFI value in your main function and we call that program P. But here you are not calling program P right in your to get all this result, you are calling the mutants feeding them with SI and FI values right? Now, when implementing the program, it's strongly recommended not to use any standard functions or libraries provided by the programming language, since this may reduce the number of statements in the source code, thus reducing your option to create mutated statements.

**[20:14]:** If those programming language has some functions, for example sum function or addition function, that you just give it an array or a list of number, it will help you to add up. Please don't use that function because when you use that, the number of mutation is. I mean how many statement can you muted after that? Probably your number your lines of code is very few. I need you to have a lot of lines of code.

**[20:45]:** That's why you need to manually so called add them up like you have a loop. Then look through the all the values in the in that SI or fi, then add them up, then apply the text and so on. So this will definitely give you quite a number of Lines of code so you can make your mutations there. Okay, Then in this assignment you are allowed to form mutants by deleting executable statement which can be missed regarded as being mistaken as a comment. A programmer may accidentally commented of some code so that can be considered as creation of mutant.

**[21:30]:** But you need to come your you need to be able to compile your program. If you try to compile it says an error, then you don't consider that as a valid mutant. Okay, so must be able to compile your table violation and console output display must follow closely the format given. So just another remind reminder this table please follow closely. Okay?

**[21:58]:** Of course the spacing of the all this can adjust a bit, but all these fields need to have okay, follow exactly. Every student as well as this display. Follow exactly. Okay, all the wording, all this follow exactly.

**[22:19]:** Then we come to our marking criteria. I will not be talking about all this, but you can look at it by yourself. Program implementation like I will be looking at your source code. Well structured Program P implemented as a collaboration function. Full code is given in appendix Test case design.

**[22:37]:** Your justification all these mutant creation. Okay, Your MTG construction, your experimentation of the effectiveness. Okay, so table of violation effectiveness score calculation. Okay, Console output screenshot. All this and then your comparison and your discussion about the two questions.

**[23:03]:** Okay? Insightful, well supported discussion using evidence from experiment, logical reasoning and so on. And then finally you have the report. Quality professional, highly comprehensible Report is well organized, very tidy. Okay.

**[23:19]:** Flows very well from one section to another section. Okay. Language is precise, free of errors. All this, take a look at it yourself. You want to aim for the excellent standard, definitely.

**[23:33]:** Okay. But of course you perform according to the level that you are in and you be achieving those levels.

**[23:47]:** Now, I think that's all for this briefing. So as usual, welcome for consultation. You can feel free to chat with us if you require any clarification. All the best in your assignment too.
