首页 > 其他分享 >FIT2107 - Software Quality and Testing

FIT2107 - Software Quality and Testing

时间:2024-10-14 15:35:26浏览次数:1  
标签:tests task Testing BAT will FIT2107 test Quality your

FIT2107 - Software Quality and Testing

ASSIGNMENT 2 [40%]White box testing and code analysis

Overview

For this assignment, your task is to design and document appropriate tests for asoftware system using white box techniques, build a CI/CD pipeline to run your tests,and report on the code quality and test coverage. In doing this you must only use concepts that have been covered in FIT2107.This assignment is an individual, open book task. Every student must complete andsubmit their own work. The use of AI in any way is not permitted.Submissions will be marked out of 40, and will form 40% of your final grade in FIT2107. Alate penalty of 5% per day will be applied, and after 7 days a mark of 0 will be given andno feedback will be provided on the submission.This assignment covers FIT2107 learning outcomes 1, 2, and 3.

Deliverables

You must submit the following evidence using the Assignment 2 submission page onMoodle:

  • Your testsCompress your “tests” folder from “bat” to a zip named “tests.zip”.
  • Task 6 and Task 9 documentsConvert both documents to PDF for submission, and do not rename them (i.e., youshould submit files named “task_6.pdf” and “task_9.pdf”).
  • Task 3 control flow graphSubmit as “task_3.png”

Your grade will also be based on the commit history in your unit repository on gitlab.

SUBMISSION DUE: Friday Week 12, 11:55PM

1FIT2107 - Software Quality and Testing

Tasks

For this assignment you are continuing to test the Borrowing Administration Terminal (BAT) used by Anything Anytime Library (AAL). However, now you will have access tosome of the BAT code. This will enable you to run additional tests on the system usingwhite box techniques.The code you have been provided with is a redacted version of BAT. Each part of thecode has been commented to describe its purpose and intended logic. In addition tothe in-code documentation, you should note:

  • It is assumed that a patron will never attempt to take out a loan for an item they

re already borrowing (e.g., borrow two copies of the same book).

  • It is assumed that there are no patrons with the same name and age.
  • It is assumed that there are no logic errors in the JSON data provided to BAT (e.g.,duplicate IDs, loans which aren't reflected in the catalogue). If there are anysyntax errors in the data then BAT will not open.
  • Changes to data are not saved until the "Quit" menu option is selected.
  • All functionality to do with late fees has been removed, except the calculation ofdiscounts for the purpose of determining if a patron is allowed to borrow an itemor is not allowed due to fees owed.
  • Ability to update training records has been removed.
  • All analytics code (e.g., for generating overdue loans reports) has been removed.
  • All user and catalogue data is fabricated.

2FIT2107 - Software Quality and Testing

Task 1: File Setup (Marked as part of development history modifier)

You should have the knowledge to complete this task after Week 1. Download the assignment template (template.zip) from Moodle. Unzip the folder, and

copy all of the files into the “Assignment 2” 代 写FIT2107 - Software Quality and Testing folder in your unit repository. Add, commit,and push the files.

Task 2: MC/DC (4 marks)

You should have the knowledge to complete this task after Week 7.

In the file “test_task_2.py” in the “tests” folder in “bat”, write tests for the method

“can_borrow_carpentry_tool” from the “business_logic.py” source file. Write the

minimum number of tests needed to reach 100% MC/DC for the condition on line 126. Do

not write any extra tests.

Document your tests in comments as shown in the week 7 answer guide for MC/DC.

Your documentation must:

  • List the possible tests and their outcomes, numbering each test.
  • List the optimal test sets.
  • Clearly identify which optimal set you have chosen to implement.
  • Clearly identify which test number is being tested by each test method.

Task 3: Path Coverage (5 marks)

You should have the knowledge to complete this task after Week 7.

Part A:Draw a control flow graph for the method “can_use_makerspace” from the“business_logic.py” source file. In your graph, show “else” explicitly as a node. Save yourgraph in the “Assignment 2” folder in your repository as “task_3.png”.Part B:

In the file “test_task_3.py” in the “tests” folder in “bat”, write tests for the method

“can_use_makerspace” (from the “business_logic.py” source file). Write the minimumnumber of tests needed to reach 100% path coverage. Do not write any extra tests.

Document your tests in comments as shown in the week 7 answer guide for pathcoverage. Your documentation must:3FIT2107 - Software Quality and Testing

  • List the feasible paths, number each.
  • Clearly identify which path is being tested by each test method.

Task 4: Mocking (5 marks)

You should have the knowledge to complete this task after Week 8.

In the file “test_task_4.py” in the “tests” folder in “bat”, write tests for the method

“_main_menu” from the “bat_ui” source file. Use the method “get_current_screen” to

verify that the UI has moved to the correct screen. Do not write any extra tests.

Make sure you test that:

  • All valid inputs cause the UI to move to the correct screen.
  • The user is repeatedly asked for input until a valid input is given.

Task 5: Coverage (10 marks)

You should have the knowledge to complete this task after Week 8. In the “tests” folder in “bat”, write tests for any of the code in BAT you like until you reach:

  • At least 90% statement coverage.
  • At least 80% branch coverage.

All tests written for this assignment (i.e., not just for Task 5) count towards coverage.

Add as many test files to the “tests” folder as you need, but do not add tests to the“test_task_X.py” files, and do not rename any of the “test_task_X.py” files. Part of yourgrade for this task will be based on your ability to write appropriate tests, and organise

them into appropriately named test files. Make sure you follow all guidelines given inthis unit.Note: to get just branch coverage, run the terminal command “coverage json” after a

“coverage run” command. This will generate a file (“coverage.json”). In that file, under

"totals" there'll be "covered_branches" and "missing_branches".

Task 6: Find the Bugs (9 marks)

You should have the knowledge to complete this task after Week 8.

Part A:

Using any technique or combination of techniques you like, find 3 bugs in BAT.Part B:In “task_6.docx” in the assignment template, write a bug report for each of the threebugs you found.

Task 7: CI (2 marks)

You should have the knowledge to complete this task after Week 9.

4FIT2107 - Software Quality and Testing

Configure gitlab to automatically run all of the tests you have written for BAT. Ensurethat only the BAT tests run, and the output is verbose. Gitlab should show that all yourtests were run, and all your tests pass.

Task 8: Static Analysis (2 marks)

You should have the knowledge to complete this task after Week 9.

Update your gitlab configuration to also automatically run the “pylint” and“pycodestyle” static analysis tools on the BAT source code and tests. Gitlab should

show that all your tests were run and pass, but the code does not have to pass linting.Task 9: Software Metrics (3 marks)

You should have the knowledge to complete this task after Week 10.

As mentioned, you have been given a redacted version of the BAT code. The real

version of BAT has 9842 lines of code.

In “task_9.docx” in the assignment template, explain (including your working) how

many defects you would expect the real version of BAT to contain. Your answer should

not be longer than one page.

Assessment Criteria

This assignment will be marked out of 40, and will form 40% of your final grade in

FIT2107. A late penalty of 5% per day will be applied, and after 7 days a mark of 0 will be

given and no feedback will be provided on the submission.

  • Development history

After your submission is marked, a modifier will be applied to your score based on

your development history. The lowest possible modifier is 0.5, and the highest

possible modifier is 1.0 (i.e., no grade reduction). Your final grade will be your

original grade multiplied by this modifier. To get a modifier of 1.0 you need to:

○ Have all the files from the assignment template in the “Assignment 2”

folder in your unit repository, and not in a sub-folder.

○ Make at least 11 commits total.

○ Make at least 2 commits of each file in the template.

○ Use meaningful and concise commit messages.

  • Appropriate use of unit conceptsThe marker will verify that you have used only concepts covered in FIT2107.
  • CorrectnessThe marker will verify the correctness of your answers.
  • ClarityThe marker will verify whether your answers use clear, specific, and appropriateexamples. This is particularly important when you are writing justifications.5FIT2107 - Software Quality and Testing
  • ConsistencyThe marker will verify whether related answers are consistent with each other.

Good coding practice

The marker will verify whether you have followed good coding practice for writingtests in python, as demonstrated in this unit.6

标签:tests,task,Testing,BAT,will,FIT2107,test,Quality,your
From: https://www.cnblogs.com/comp9313/p/18464304

相关文章

  • 【论文解读】KVQ: Kwai Video Quality Assessment for Short-form Videos
    原文链接:https://arxiv.org/pdf/2402.07220级别:IEEE/CVF机构:快手作者:YitingLu时间:2024可下载地址:KVQ:KwaiVideoQualityAssessmentforShort-formVideos摘要UGC(用户生成内容)短视频平台,如快手(Kwai)和抖音(TikTok),已经成为一种新兴且不可替代的主流媒体形式。......
  • 【Canvas与标牌】盾形银底红带Best Quality Premium标牌
    【成图】【代码】<!DOCTYPEhtml><htmllang="utf-8"><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><head><title>BestQulityPremium金属牌重制版Draft2</title><s......
  • ROS报错The target name "test" is reserved when CTest testing is enabled
    ROS报错“Thetargetname“test“isreservedwhenCTesttestingisenabled”注意:现有特殊情况,可执行文件名可以为test,但是映射名称不可以为test。一般认为,可执行文件名和映射名称同名。因为映射名称不可命名为test,故可执行文件最好不要命名为test。纠正:ROS遇到的问题......
  • 【处理元组有关的题型的技巧】codeforces 1677 A. Tokitsukaze and Strange Inequalit
    题意第一行输入一个正整数\(T(1\leqT\leq1000)\),代表共有\(T\)组测试用例,对于每组测试用例:第一行输入一个正整数\(n(4\leqn\leq5000)\),第二行输入\(n\)个正整数\(p_i(1\leqp_i\leqn)\)。对于\(1\leqi<j<k<l\leqn\),若有\(a_i<a_k,a_j>a_l\)成......
  • vulnhub入门靶场:basic_pentesting
    靶机下载链接:https://download.vulnhub.com/basicpentesting/basic_pentesting_1.ova一、环境安装双击下载好的.ova文件即可在VMware上打开网卡这里确保与kali使用同一网卡,处于同一网段二、信息收集先确定kali的ip:192.168.231.133扫描一下靶机的ip:192.168.231.196ar......
  • vulnhub-Basic Pentesting 2靶机
    vulnhub:https://www.vulnhub.com/entry/basic-pentesting-2,241/导入靶机(建议VirtualBox,VMWare扫不到),放在kali同网段,扫描靶机在192.168.81.3,扫描端口很多端口,存在网站服务,访问啥也没有查看8080端口是Tomcat的页面,也没啥东西尝试从ssh服务突破,枚举用户enum4li......
  • 【Canvas与艺术】红色六角Premium Quality标志
    【成图】【代码】<!DOCTYPEhtml><htmllang="utf-8"><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><head><title>六角红色PremiumQuality</title><styletyp......
  • LEAN 类型系统属性 之 定义上相等的非确定性(Undecidability of Definitional Equality
        由于定义上相等(DefinitionalEquality)作用在所有情况,由此,当遇到不一致(Inconsistent)的时候,会导致其结果是不确定的,即会无限展开(unfoldingforever)下去。    原文中,是通过一个定义在自然数(ℕ)的大于关系(>)上的可达类型(AccessibilityType)来论证,这个看原文很好......
  • Panasonic Programming Contest 2020 C (Sqrt Inequality) 题解
    题目大意输入三个整数\(a\),\(b\),\(c\),如果\(\sqrta+\sqrtb<\sqrtc\)成立,输出Yes,否则输出No。样例输入#1239输出#1No\(\sqrt2+\sqrt3<\sqrt9\)不成立。输入#22310输出#2Yes\(\sqrt2+\sqrt3<\sqrt10\)成立。分析错误思路首先,由......
  • A Fast and High Quality Multilevel Scheme for Partitioning Irregular Graphs
    目录概METISCoarseningPartitioningphaseUncoarseningphaseKarypisG.andKumarV.Afastandhighqualitymultilevelschemeforpartitioningirregulargraphs.SIAM,1998.概本文提出了一种multilevelgraphpartitioning方法.METISMETIS的思想比较简单:......