讲解:Java:COMS417 Software TestingJava

代写Java作业,编写软件测试用例。Objective and OutlineThis lab has two parts. The first part focuses on CFG generated tests implemented as simple junit tests. The second part focuses on black-box tests implemented as parameterized junit tests.For Part I you are to:1) create a Control Flow Graph (CFG) to model a supplied utility method named getParametersFromFile();2) use that CFG to create a test set which achieves the most complete edge-pair coverage you can find for the getParametersFromFile() method; and3) create a non-parameterized junit test class named CfgTests for the test set you created;4) execute the test class; and5) create a defect report (see below) for any failures detected.For Part II you are to:1) define an input partitioning for the method countOs();2) use that partitioning to design an all combinations test set for the method;3) document the design;4) enter the test cases required by your design into a spread sheet;5) create a parameterized junit test class PartIITests that will execute all entries in your part II test set against countOs(); and6) create a separate non-parameterized junit test class DefectsFound with individual tests to replicate any failures you detect.General InstructionsWe have supplied a template package for this lab. The template includes a demo package you can refer to for the basic structure of a Parameterized test. CfgTests will be similar, but must dynamically create the object representing the test set.The template is complete except for the CfgTests, PartIITests, and DefectsFound. All test code must be placed in the test source directory. The src directory only contain the demo and util packages. Do not attempt to create your own implementation of Counter or Counter.countOs(). In part II, you must use the supplied jar as the software under test.The required test design documents and defect reports are the most important part of this lab. You should expect them to account for about 75% of your grade. Do not omit them. Getting running/passing tests for this lab is not what this lab is about. Make certain the documents you turn in clearly demonstrate that you understand the requested test design processes.Begin by examining the Javadoc in the template and correlating the classes and placeholders there with entities and deliverables mentioned in this document. Be sure you understand the intended role of each part.While not absolutely necessary, we suggest you start with Part I, as writing the tests for getParametersFromFile() should assure you have a clear understanding of how it works, making it easier for you to incorporate it into PartIITests.Do Not write your own file reading code for part II. You will lose points if you do not use getParametersFromFile() and only getParametersFromFile() to read your test set data.You should submit your project as a zip. That zip must include the project file/package hierarchy and all artifacts requested in this document - each placed where directed.Just to avoid counter-productive assumptions: there are no aspects of Lab1 required to complete this lab! This lab involves no understanding of RIPR and has no need of instrumentation in the software under test. This lab is about test set design using input-partitioning (part I), graph-based models(Part II), and Parameterized tests (Part II).All test code must be in the test source folder.There is no application for this lab - there are only classes containing methods that need testing. If you think you need to create a main() method to do this lab, please see the instructor or a TA immediately.Warning: many programming editors automatically replace tab characters with the right number of spaces. Space delimited columns will not be recognized correctly by getParametersFromFile().You should complete author tags in the files you write.You should supply meaningful java doc for individual (non-parameterized) junit tests.You should submit your complete project (minus bin directory and standard jars) as a zip file, with file hierarchy. We will take of points if we need to reorganize files or supply missing files or deal with huge downloads of stuff that is just a normal part of a java development environment.Part I NotesIn the template package (available via blackboard), static method getParametersFromFile() is a member of class FileUtil, located in package. You should use the source code for and any accompanying javadoJava代写:COMS417 Software Testing代做留学生Java语言cs as the basis for your CFG and resulting test set.Before you write the test class, you should produce a design document that captures your CFG, shows the basic block boundaries you identified in the source, shows the paths you are using to generate your test sets, and identifies the specific test cases associated with each path. Name this document “Part I test design” and include it the submitted project’s “doc” folder.Your junit test class for Part I (CfgTests) will include one @Test annotation and test function for each test case in your Part I test set. Note, because you are testing a method which reads data from a file, you will need to include appropriate files for your tests to access. Depending on how you partition the input, you will probably only need a small number of these files to support the tests. (Think about the requirements given in the Javadoc and ask yourself “what would a file that triggered the behavior specified in requirement “xxxx” look like?)Remember: correct behavior is the behavior specified in the requirements not just behavior that passes or fails some test.For Part I, FileUtil.getParametersFromFile() is the Software Under Test. Part I will not make any use of class Counter. Part I will not make any use of RunWith or Parameterized. While working on Part I, pretend Part II and Counter do not exist.If any of your test cases uncover a failure, include a file named ‘Part I Defects’. In that file, for each detected failure, give the input value which triggers the failure and an explanation of what you think is the underlying fault. If you find no failures, then all tests in CfgTests should complete “green”.Part II NotesImportant: If you find defects in Part I, do not try to fix them for Part II. Use only the template’s unmodified version of FileUtil.getParametersFromFile() when working on part II.The countOs() method is supplied as a non-static member of class Counter, in the pre-compiled and obfusucated jar, counter.jar. This jar located in the template project’s lib folder. For your test code to be able to execute this jar, the project must be configured to look for it. See the first two answers in this stackoverflow item for guidance: https://stackoverflow.com/questions/3280353/how-to-import-a-jar-in-eclipseFor Part II, countOs() is the software under test and is the only software under test. Everything else is just file read and test support.Because of how the Counter class is packaged, you do not have any access to the source code or design documents. Thus, the test set you create in Part II is inherently limited to black box tests. Your only information about this method and its requirements is supplied in the Javadoc description later in this document.Before you write your test class, document the test design in a file named “Part II Test Design”, placed in the project doc folder. The design document should give the characteristics (partitioning rules) used to partition each input, with block (or partition) names for each equivalence set, a table showing how you selected from these to achieve all combinations coverage, and a table showing what representative value from each equivalence set was used as a representative value when composing test cases.The spread sheet containing your test cases should be three columns wide and have a single line header with the column names: “filename columns expected”. The original spread sheet should be saved in whatever is a native format for your spreadsheet application and placed in the “doc” directory. To use these test case values in test execution, you must export the contents of this file to a tab-delimited text file named testdata.txt, located at the root of the project.You can refer to the parameterized junit test class in the demo package when creating your parameterized PartIITests class. Your class, however must use FileUtil.getParametersFromFile() to read the test cases in testdata.txt to construct the data object that will represent all the entries in your part II test set.Important: You must use @RunWith(Parameterized.class) and @Parameterized. No points will be given for any other alternatives.If your test set identifies failures (defects in countOs()), create a separate test class DefectsFound with separate unit tests specific to each failure.Notice the package you must use to load Counter.转自:http://ass.3daixie.com/2019012364640146.html

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,744评论 6 502
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,505评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 163,105评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,242评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,269评论 6 389
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,215评论 1 299
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,096评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,939评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,354评论 1 311
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,573评论 2 333
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,745评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,448评论 5 344
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,048评论 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,683评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,838评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,776评论 2 369
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,652评论 2 354

推荐阅读更多精彩内容

  • 一、多给他一些尊重 女人们就不要在家庭里与男人发生权利之争。不妨把家庭主权让给男人,让丈夫多一份自尊,让他在人前人...
    红豆印迹阅读 529评论 0 0
  • 最喜欢的日子莫过于拉开窗帘让阳光跳进来,铺满整个房间。 我觉得阳光能够走进人的心里,温暖的让你触不及防。而在这时候...
    陆松风阅读 685评论 5 6