首页 > 其他分享 >Anything Anytime Library

Anything Anytime Library

时间:2024-10-16 12:10:28浏览次数:7  
标签:tests task Anything Anytime will Task Library test your

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

Overview

For this assignment, your task is to design and document appropriate tests for a softwaresystem using white box techniques, build a CI/CD pipeline to run your tests, and reporton the code quality and test coverage.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.

  • 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 graph Submit as “task_3.png”Your grade will also be based on the commit history in your unit repository on gitlab.

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 accesstoome 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 the codehas been com代 写Anything Anytime Library mented to describe its purpose and intended logic. In addition to the incode documentation, you should note:

  • It is assumed that a patron will never attempt to take out a loan for an item theyare 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 any syntaxerrors in the data then BAT will not open.
  • Changes to data are not saved until the "Quit" menu option is selected.2
  • 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.

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” 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 theminimum 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:3In 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:

  • 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” toverify 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 organisethem into appropriately named test files. Make sure you follow all guidelines given in this

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.4Part B:In “task_6.docx” in the assignment template, write a bug report for each of the three bugsyou found.

Task 7: CI (2 marks)

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

Configure gitlab to automatically run all of the tests you have written for BAT. Ensure thatonly the BAT tests run, and the output is verbose. Gitlab should show that all your testswere 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 yourtests 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 versionof BAT has 9842 lines of code.In “task_9.docx” in the assignment template, explain (including your working) how manydefects you would expect the real version of BAT to contain. Your answer should not belonger 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 andno feedback will be provided on the submission.

  • Development historyAfter your submission is marked, a modifier will be applied to your score based onyour development history. The lowest possible modifier is 0.5, and the highestpossible modifier is 1.0 (i.e., no grade reduction). Your final grade will be your originalgrade 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” folderin 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 concepts5The 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.
  • ConsistencyThe marker will verify whether related answers are consistent with each other.
  • Good coding practiceThe marker will verify whether you have followed good coding practice for writingtests in python, as demonstrated in this unit.

标签:tests,task,Anything,Anytime,will,Task,Library,test,your
From: https://www.cnblogs.com/comp9313/p/18468999

相关文章

  • Stanford CS149 -- Assignment 2: Building A Task Execution Library from the Groun
    作业描述及代码参见:CS149-asst2PartAStep1只需要实现一个简单的任务系统,在run()的开始生成工作线程,并在run()返回之前从主线程合并这些线程。任务的分配方式采用动态分配,即每个线程每次取一个任务完成,能者多劳。每个线程的核心实现为:while(true){inttaskID=done+......
  • 【视觉分割新SOTA】一种最先进的图像分割模型!Segment Anything Model (SAM)如何使用?附
    【视觉分割新SOTA】一种最先进的图像分割模型!SegmentAnythingModel(SAM)如何使用?附代码和解释。【视觉分割新SOTA】一种最先进的图像分割模型!SegmentAnythingModel(SAM)如何使用?附代码和解释。文章目录【视觉分割新SOTA】一种最先进的图像分割模型!SegmentAnyth......
  • tdbox导航Z-Library最新入口官方国内可用网址
    Z-library,被誉为全球范围内最为庞大的数字图书馆之一,其藏书量之丰富令人叹为观止,总计囊括了超过9,826,996册电子书及84,837,646篇学术期刊文章。Z-Library最新的入口(需要梯)https://zh.singlelogin.rehttps://zh.singlelogin.rshttps://z-lib.gshttps://zh.z-lib.gshttps://z......
  • zlibrary数字图书馆官网镜像网址及客户端入口(长期更新)
    zlibrary数字图书馆介绍Z-library,被誉为全球范围内最为庞大的数字图书馆之一,其藏书量之丰富令人叹为观止,总计囊括了超过9,826,996册电子书及84,837,646篇学术期刊文章。这座庞大的知识宝库覆盖了从经典文学巨著到前沿理工学科,从人文艺术瑰宝到专业学术论文的广泛领域,几乎能够......
  • 24h搜书zlibrary镜像网址入口(2024更新中)
    24h搜书简介24h搜书网是一个基于IPFS(InterPlanetaryFileSystem,星际文件系统)的电子书搜索引擎,由@deepsixnone搭建。它共收录了超过12.7万本图书,支持在线预览、书籍分类和集成搜索。该网站提供了海量的电子书资源,书籍分类多且井然有序,用户可以通过书名、ISBN编号、作者、出版......
  • zlibrary镜像网址入口以及客户端app集合(2024持续更新)
    zlibrary数字图书馆介绍Z-library,被誉为全球范围内最为庞大的数字图书馆之一,其藏书量之丰富令人叹为观止,总计囊括了超过9,826,996册电子书及84,837,646篇学术期刊文章。这座庞大的知识宝库覆盖了从经典文学巨著到前沿理工学科,从人文艺术瑰宝到专业学术论文的广泛领域,几乎能够......
  • import mindnlp报错:OSError: cannot load library ‘libsndfile.so‘: libsndfile.so:
    在启智平台AI调试环境下,安装mindnlp后,importmindnlp报错。安装mindnlp命令:#安装mindnlp的daily包,待正式发布后可改为直接安装mindnlp包!pipinstallhttps://mindspore-courses.obs.cn-north-4.myhuaweicloud.com/mindnlp/mindnlp-0.4.0-py3-none-any.whl-ihttps://pypi.......
  • [20241006]跟踪library cache lock library cache pin使用gdb(补充测试3).txt
    [20241006]跟踪librarycachelocklibrarycachepin使用gdb(补充测试3).txt--//补充测试产生光标已经缓存的情况下,生成新子光标的调用librarycachelocklibrarycachepin的情况。1.环境:SCOTT@book01p>@ver2==============================PORT_STRING          ......
  • Z-library数字图书馆镜像地址及客户端/app(持续更新)
    Z-library数字图书馆介绍Z-library,被誉为全球范围内最为庞大的数字图书馆之一,其藏书量之丰富令人叹为观止,总计囊括了超过9,826,996册电子书及84,837,646篇学术期刊文章。这座庞大的知识宝库覆盖了从经典文学巨著到前沿理工学科,从人文艺术瑰宝到专业学术论文的广泛领域,几乎能够满......
  • zlibrary 最新官方国内可用网址入口及电脑客户端集合(2024持续更新)
    Z-library,被誉为全球范围内最为庞大的数字图书馆之一,其藏书量之丰富令人叹为观止,总计囊括了超过9,826,996册电子书及84,837,646篇学术期刊文章。这座庞大的知识宝库覆盖了从经典文学巨著到前沿理工学科,从人文艺术瑰宝到专业学术论文的广泛领域,几乎能够满足每一位求知者的阅读与学......