Coding help with the file attached

Get perfect grades by consistently using www.college-experts.com. Place your order and get a quality paper today. Take advantage of our current 20% discount by using the coupon code GET20


Order a Similar Paper Order a Different Paper

Coding help with the file attached

Coding help with the file attached
Individual Project: textprocessor Deliverable 1 Project Goals In this project, you will be developing a simple Java application ( textprocessor ) using an agile, test -driven process involving multiple deliverables. While you will receive one grade for the entire project, each deliverable must be completed by its own due date, and all deliverables will contribute to the overall project grade. Specification of the textprocessor Utility textprocessor is a command -line utility written in Java with the following specification: Summary textprocessor allows for simple text manipulation of the contents of a file. Syntax textprocessor [OPTIONS] FILE Description Program textprocessor performs basic text transformations on lines of text from a n input FILE . Unless the -o option (see below) is specified, the program writes transformed text to stdout and errors/usage messages to stderr. The FILE parameter is required and must be the last parameter. OPTIONS may be zero or more of the following and may occur in any order: ● -o The program writes the output to output_file_name with transformed text instead of writing to stdout. If output_file_name already exists, the program shall result in an error. ● -i Used with the -r flag and -k fl ag ONLY; the search of -r or -k becomes case – insensitive. ● -k Keep only the lines containing substring . The search for substring is case – sensitive, unless option -i is set. This option must be mutually exclusive with -r below. ● -r Replaces the first instance of string old in each line with string new . The search for old is case -sensitive, unless option -i is set. This option must be mutually exclusive with -k above. ● -s Adds the string suffix at the end of each line. ● -n Add a line number followed by a single space to the beginning of each line, where padding is an integer in the inclusive range of 1 to 9 specifying the minimum padding of t he line number field. If the number of digits in the line number is less than the specified padding, zeros are left padded until the minimum padding is reached. If the number of digits in the line number is greater than the specified padding, the line numb er is never truncated . Line numbering should start at 1. This option must be mutually exclusive with -w below. ● -w Removes all whitespace from lines. For this assignment, whitespace will count as any spaces, ” “, or tabs, ” t”, in the input file. It must be mutually exclusive with -n above. NOTES : ● While the last command -line parameter provided is always treated as the filename, OPTIONS flags can be provided in any order and shall be applied as follows : ○ Options -o/-i shall be processed first, as they determin e global parameters of the computation. ○ Options -k, -r, -n, -w, and -s, shall be processed in this order. That is: (1) if -k is present, then the file content is filtered based on the specified parameter, using a case insensitive search if -i is present; ( 2) if -r is present, then replacements are performed based on the option parameters, using a case insensitive search if -i is present; (3) if -n is present, then a line number is applied; (4) if -w is present, then whitespace from the line is removed; (5) if -s is present, then a suffix shall be applied. ● To keep this application simple, all errors shall result in display of the standard usage message. ● Specifying option -i without having specified option -r or -k shall result in an error. ● Specifying option -k with an empty string as the parameter should keep all input lines. ● Specifying option -r with an empty string as the parameter or option -s with an empty string as the parameter shall result in an error. ● Specifying options -r an d -k simultaneously shall result in an error. ● Specifying option -n with a non -integer value or an integer out of range shall result in an error. ● Specifying options -n and -w simultaneously shall result in an error. ● If options are repeated, only their last occurrence is applied. ● All program option parameters are required, resulting in an error if omitted. ● You shall assume that the command line parameter strings will not contain newline characters ( r, n, and so on), as the behavior of the program would be platform dependent and may result in errors during grading. Therefore, there should be no test cases using these values as option parameters . ● An empty input file shall produce an empty output file. ● The last line of a non -empty input file must be newlin e terminated. Otherwise, the program shall generate an error. EXAMPLES OF USAGE (In the following, “↵” represents a newline character.) Example 1 : textprocessor -o sample.txt FILE input FILE : This is the first line of the input file. ↵ output sample.txt : This is the first line of the input file. ↵ stdout : nothing sent to stdout stderr : nothing sent to stderr Example 2 : textprocessor -r 02 two FILE input FILE : Some words are: “one”, “02”, and “three” ↵ output file : output file not created stdout : Some words are: “one”, “two”, and “three” ↵ stderr : nothing sent to stderr Example 3 : textprocessor -i -r the A FILE input FILE : The file ↵ the file ↵ output file : output file not created stdout : A file ↵ A file ↵ stderr : nothing sent to stderr Example 4 : textprocessor -s er FILE input FILE : This is cool ↵ output file : output file not created stdout : This is cooler ↵ stderr : nothing sent to stderr Example 5 : textprocessor -k Java FILE input FILE : java is one of the programming languages. ↵ Java is a programming language. ↵ Programming languages are neat, an example of one is Java. ↵ output file : output file not created stdout : Java is a programming language. ↵ Programming languages are neat, an example of one is Java. ↵ stderr : nothing sent to stderr Example 6 : textprocessor -r Question Exclamation -o text -s ! -w FILE input FILE : This Sentence Ends In A Question Mark? ↵ output text : ThisSentenceEndsInAExclamationMark?! ↵ stdout : nothing sent to stdout stderr : nothing sent to stderr Example 7 : textprocessor -n 8 -n 2 -s ## –s ! FILE input FILE : I wish this line had a line number.. ↵ I also wish that.. ↵ output file : output file not created stdout : 01 I wish this line had a line number..! ↵ 02 I also wish that..! ↵ stderr : nothing sent to stderr Example 8 : textprocessor input FILE : Today is January 65, 2298. ↵ Yesterday was December 0, 3000. ↵ Tomorrow we will time travel again. output file : output file not created stdout : nothing sent to stdout stderr : Usage: textprocessor [ -o filename | -i | -k substring | -r old new | -n padding | -w | -s suffix ] FILE Example 9 : textprocessor -i -k #keep -n 1 -s # FILE input FILE : This course’s title is CS6300. #keep ↵ CS stands for Counter Strike. ↵ It is part of the OMSCS program. #KEEP ↵ output file : output file not created stdout : 1 This course’s title is CS6300. #keep# ↵ 3 It is part of the OMSCS program. #KEEP# ↵ stderr : nothing sent to stderr Example 10 : textprocessor -r -k -s FILE input FILE : This list contains words that start with -k: ↵ -kale ↵ -kilo ↵ -kite ↵ – knot ↵ output file : output file not created stdout : This list contains words that start with -s: ↵ -sale ↵ -silo ↵ -site ↵ – knot ↵ stderr : nothing sent to stderr Deliverables Summary This part of the document is provided to help you keep track of where you are in the individual project and will be updated in future deliverables. Deliverable 1 (this deliverable, see below for details) ● Provided: ○ textprocessor specification ○ Skeleton of the main class for textprocessor ○ Example tests and skeleton of the test class to submit ○ JUnit library ● Expected: ○ Part I (Category Partition) ■ catpart.txt : TSL file you created ■ catpart.txt.tsl : test specifications generated by the TSLgenerator to ol when run on your TSL file. ○ Part II (Junit Tests) ■ Junit tests derived from your category partition test frames (MyMainTest.java ) Deliverable 2 ● Provided: TBD ● Expected: TBD Deliverable 3 ● Provided: TBD ● Expected: TBD Deliverable 4 ● Provided: TBD ● Expected: TBD Deliverable 1: Instructions Deliverable 1 is split up in two parts: Part I and Part II. Follow the instructions for each of the parts as described below. Part I Generate 50 through 90 test -case specifications (i.e., generated test frames) for the textprocessor utility using the category -partition method presented in lesson P4L2. Make sure to watch the lesson and demo before getting started . When defining your test specifications, your goal is to suitably cove r the domain of the application under test, including relevant erroneous inputs and input combinations . Just to give you an example, if you were testing a calculator, you may want to cover the case of a division by zero. Do not manually generate combinatio ns of inputs as single choices. Instead, use multiple categories and choices with necessary constraints to cause the tool to generate meaningful combinations. Using the calculator example again, you should not offer choices ” add” , ” multiply” , and also ” add and multiply” in a single category. In particular, make sure to use constraints (error and single), selector expression (if), and properties appropriately, rather than eliminating choices, to keep the number of test cases within the specified thresholds. Note that the domain is that of the Java application under test , so you can assume that anything the shell would reject (e.g., unmatched double quotes) will not reach the application. In other words, you must test for invalid input arguments, but do not ne ed to test for errors involving parsing the command -line arguments before they are sent to the java application . In other words, you may assume that Main.main() will be called with a valid String[] of args. Although this application will only use the simpl ified command -line parsing given in the specification above, you can find more details about comprehensive command -line argument parsing at this link (GNU “Prog ram Argument Syntax Conventions”). To illustrate, the sample tests in Part II will demonstrate how input arguments would be sent to your application. Please also keep in mind that you are only required to specify test inputs, but you do not have to specify the expected outcome for such inputs in Part I . It is therefore OK if you do not know how the system would behave for a specific input. Using the calculator example, you could test the case of a division by zero even if you did not know how exactly the calculator would behave for that input. Tools and Useful Files You will use the TSLgenerator tool to generate test frames starting from a TSL file, just like we did in the demo for lesson P4L2. Versions of the TSLgenerator for Linux, Mac OS X, and Windows, together with a user manual, are available at: ● TSLgenerator -manual.txt ● TSL generator for Linux ● TSL generator for Mac OS ● TSL generator for Windows 8 and newer ● TSL generator for Windows XP and earlier We are also providing the TSL file for the example we used in the lesson, cp -example.txt , for your reference. Important: ● These are command -line tools , which means that you have to run them from the command line , as we do in the video demo , rather than by clicking on them. ● On Linux and Mac systems, you may need to change the permissions of the files to make them executable using the chmod utility. To run the tool on a Mac, for instance, you should do the following, from a terminal: chmo d +x TSLgenerator -mac ./TSLgenerator -mac ● You can run the TSLgenerator as follows: [ — manpage] [ -cs] infile [ -o outfile] Where is the specific tool for your architecture, and the command -line flags have the followi ng meaning: — manpage Prints the man page for the tool. -c Reports the number of test frames that would be generated, without actually producing them . -s Outputs the result to standard output. -o outfile Outputs the result to file outfile, unless the -s option is also used . ● If you encounter issues while using the tool, please post a public question on Ed Discussion and consider running the tool on a different platform (if you have the option to do so). G radescope will execute the tool on a Linux platform. Committing Part I ● Create a directory ” IndividualProject ” in the personal GitHub repo we assigned to you . ● Add to this new directory two text files: ○ catpart.txt : TSL file you created. ○ catpart.txt.tsl : test specifications generated by the TSLgenerator tool when it processes your TSL file. ● Commit and push your files to GitHub. (You can also do this only at the end of Part II, but it is always safer to have intermediate commits.) Part I I In this second part of the deliverable, you will create actual test cases implementing the test specifications you created in Part I. (As discussed in the lesson on the category – partition method, each test frame is a test spec that can be instantiated a s an individual concrete test case). To do so, you should perform the following steps: 1. Download archive individualproject -d1.tar.gz 2. Unpack the archive in the directory ” IndividualProject “, which you created in Part I of the deliverable. Hereafter, we will refer to this directory as . 3. After unpacking, you should see the following structure: a. /textprocessor/src/edu/gatech/seclass/ textprocessor/ Main.java This is a skeleton of the Main class of the textprocessor utility, which we provide so that the test cases for textprocessor can be compiled. It contains an empty main method and a method usage, which prints, on standard error, a usage message that should be called when the program is invoked incorrectly. In case you wonder, this method is provided for consistency in test results. b. /textprocessor/test/edu/gatech/seclass/textprocessor/ MainTest.java This is a test class with a fe w test cases for the textprocessor utility that you can use as an example; it corresponds to the examples of usage of textprocessor that we provided. In addition to providing this initial set of tests, class MainTest also provides some utility extensions a nd methods that you can leverage/adapt and that may help you implement your own test cases: ● Path createFile(String contents, String fileName) Creates a Path object with the specified fileName for a new temporary file in a platform -independent way with the contents provided. An additional overloaded method creates an “input.txt” file with the contents provided. ● OutputCapture capture Class field that captures standard output and standard error by using the OutputCapture extension below (d). Note that it must be registered with “@RegisterExtension ” as shown in MainTest.java to capture the output from Main . c. /textprocessor/test/edu/gatech/seclass/textprocessor/ MyMainTest.java This is an empty test class in which you w ill add your test cases, provided for your convenience. d. /textprocessor/test/edu/gatech/seclass/textprocessor/ OutputCapture.java This is a JUnit 5 extension class to facilitate capturing the standard output and standard error, which are needed to te st the textprocessor application. It is used on the MainTest.java file for reference and provides two methods to capture output from Main : ● public String stdout() Returns a String from the current standard output stream, resetting for every test executed. ● public String stderr() Returns a String from the current standard error stream, resetting for every test executed. e. /textprocessor/lib/junit -platform -console -standalone – 1.9.1.jar JUnit 5 library to be used for the assignment. 4. Use the test frames from Pa rt I to generate additional JUnit test cases for the textprocessor utility, one per frame, and put them in the test class MyMainTest (i.e., do not add your test cases to class MainTest ). For ease of grading, please name your test cases textprocessorTest1 , textprocessorTest2 , and so on. Each test should contain a concise comment that indicates which test frame the test case implements. Use the following format for your comments, before e ach test: // Frame #: Your test frames should contain enough information to create relevant test cases. If you cannot implement your test frames as useful JUnit tests (e.g., because the test frames do not provid e enough information), you should revisit Part I . Extending the calculator example, if your test frame specified a numerical input, and you realized that you should use both negative and positive numbers in your actual test case, you should revise your cat egories and choices so that this is reflected in your test frames 5. If you are uncertain what the result should be for a test, you may make a reasonable assumption on what to use for your test oracle. While you should include a test oracle, we will not grad e the accuracy of the test oracle itself. Feel free to reuse and adapt, when creating your test cases, some of the code we provided in the MainTest class. Feel also free to implement your test cases differently. Basically, class MainTest is provided for y our convenience and to help you get started. Whether you leverage the MainTest class or not, your test cases should assume (just like the test cases in MainTest do) that the textprocessor utility will be executed from the command line, as follows: java -cp edu.gatech.seclass.textprocessor.Main 6. Make sure not to make calls to System.exit() within your tests, as that creates problems for JUnit. 7. For this deliverable, do not implement the textprocessor utility, but only the test cases for it. This means that most, if not all of your test cases will fail, which is fine. Committing Part II and Submitting the Deliverable ● As usual, commit and push your code to your individual, assigned private repository. ● Make sure that all Java files are committed and pushed, including the ones we provided. ● Make sure to also commit and push the provided libraries ( lib directory). To do so, you may need to force add the jar files (i.e., ” git add -f lib/* “), which are typically excluded by the ” .gitignor e” file. ● You can check that you committed and pushed all the files you needed by doing the following: ○ Clone a fresh copy of your personal repo in another directory ○ Go to directory IndividualProject/textprocessor in this fresh clone ○ Compile your code. One w ay to do this is to run, from a Unix -like shell (on some platforms, you may need to first create directory ” classes “): javac -cp lib/ * -d classes src/edu/gatech/seclass/textprocessor/*.java test/edu/gatech/seclass/textprocessor/*.java ○ Run your tests. Aga in, from a Unix -like shell, you can run: java -cp classes:lib/ * org.junit.platform.console.ConsoleLauncher — select -class edu.gatech.seclass.textprocessor.MyMainTest 1 ● Submit on Gradescope a file, called submission.txt that contains, in two separate line s (1) your GT username and (2) the commit ID for your submission. For example, the content of file submission.txt for George P. Burdell could look something like the following: submission.txt gpburdell1 81b2f59 1 If using a W indows -based system, you may need to run java -cp “classes;lib/*” org.junit.platform.console.ConsoleLauncher — select -class edu.gatech.seclass.textprocessor.MyMainTest instead. ● As soon as you submit, Gradescope will verify your submission by making sure that your files are present and in the correct location, as well as a few additional minor checks. If you pass all these checks, you will see a placeholder grade of 10 and a positive message from Gradescope. Otherwise, you will see a grade of 0 and an error message with some diagnostic information. Please note that: ○ a positive response from Gradescope only indicates that you passed the initial checks and is meant to prevent a number of trivial errors ; ○ if your submission does not pass the Gradescope checks, it will receive a 0, so please make sure to pay attention to the feedback you receive when you submit and keep in mind that you can resubmit as many times as you want before the deadline. 2 2 Although we tested the checker, it is possible that it might not handle corre ctly some corner cases. If you receive feedback that seems to be incorrect, please contact us on Ed Discussion. Gradescope Queries If you need clarification or have questions regarding Gradescope output, please post privately on Ed Discussion (we will make it public if appropriate) and make sure to add, when it applies: ● a link to the Gradescope re sults, and ● any information that may be relevant. The bottom line is that, to make the interaction efficient, you should make your posts as self -contained and easy -to -check as possible. The faster we can respond to the posts, the more students we can help. FAQ 1. What’s next in Deliverable 2? What is the workload like? In fairness to everyone, we cannot discuss future deliverables. You will have to wait to find out the details of deliverable 2 when it’s released. 2. Can I create additional tests not generated by TSL or avoid implementing some of the generated test frames? No, for part 2 you need to stick to the test frames that were generated in part 1. 3. Aside from the program options and parameters, should the command line and file contents be considered as separate category partitions? Yes, both command lines and file content are also inputs to the program. 4. Can I re -use the example test cases (input strings, arguments, etc.) for my own test cases? Yes, you may use example test cases to devise your own. 5. Why a m I getting an error stating that a property isn’t defined even though it is? Because properties are case – and space -sensitive, make sure that defined properties don’t contain blank spaces between them and have the same case.
Coding help with the file attached
I n d iv id ual P ro je ct: t xted D eliv e ra b le 1 P ro je ct G oals I n t h is p ro je ct, y o u w il l b e d eve lo pin g a s im ple J a va a p plic a tio n ( t x te d ) u sin g a n a g il e , t e st-d riv e n p ro ce ss i n vo lv in g m ult ip le d eliv e ra b le s. W hil e y o u w il l r e ce iv e o ne g ra d e f o r t h e e n tir e p ro je ct, e ach d eliv e ra b le m ust b e c o m ple te d b y i t s o w n d ue d ate , a n d a ll d eliv e ra b le s w il l c o ntrib ute to t h e o ve ra ll p ro jec t g ra d e. S p ecifi ca tio n o f t h e t xted U til it y txted i s a s im ple c o m man d -lin e u til it y w rit te n i n J a va w it h t h e f o llo w in g s p ecifi ca tio n: S u m mary txted a llo w s f o r s im ple t e xt m an ip ula tio n o f t h e c o nten t o f a fi le . S yn ta x txted OPTIONS FILE D esc rip tio n P ro gra m txted p erfo rm s b asic t e xt t ra n sfo rm atio ns o n l in es o f t e xt f ro m a n i n p ut F IL E . U nle ss t h e – f o ptio n ( s e e b elo w ) i s s p ecifi ed , t h e p ro gra m w rit e s t ra n sfo rm ed t e xt t o s td o ut a n d e rro rs /u sa g e m essa g es t o s td err. T h e F IL E p ara m ete r i s r e q uir e d a n d m ust b e t h e l a st p ara m ete r. O PTIO NS m ay b e z e ro o r m ore o f t h e f o llo w in g a n d m ay o ccu r i n a n y o rd er: ● – f E d it fi le i n p la ce . T h e p ro gra m o ve rw rit e s t h e in p ut fi le w it h t ra n sfo rm ed t e xt i n ste ad o f w rit in g t o s td o ut. ● – e < strin g> E xclu d e a n y l in es c o nta in in g t h e g iv e n s trin g . ● – i U se d w it h t h e – e fl ag O NLY ; a p plie s c a se i n sen sit iv e m atc h in g . ● – s < i n te g er > ● S kip e it h er t h e e ve n o r o dd l in es i n a fi le, w it h 0 b ein g ev en a n d 1 b ein g o dd. ● – x < strin g> A dds s trin g a s a s u ffi x t o e ach l in e. ● – r R eve rs e t h e o rd er o f l in es i n a fi le – – t h e l a st l in e is fi rs t, t h e firs t l in e i s l a st, a n d s o o n. ● – n < i n te g er > A dd a l in e n um ber fi eld f o llo w ed b y a s in g le sp ace t o t h e b eg in nin g o f ea ch l in e o utp ut. T h e l in e n um ber fi eld s h all b e l e ft-p ad ded w it h 0 o r l e ft-t ru nca te d a s r e q uir e d t o t h e w id th s p ecifi ed b y t h e i n teg er p ara m ete r. L in e n um berin g s h o uld s ta rt a t 1 . ● N O TES : ● W hil e t h e l a st c o m man d -lin e p ara m ete r p ro vid ed i s a lw ays t re ate d a s t h e fi le n am e, O PTIO NS fl ag s c a n b e p ro vid ed i n a n y o rd er a n d w il l b e a p plie d a s f o llo w s: ○ O ptio ns – f a n d – i s h o uld b e p ro ce sse d fi rs t, a s t h ey d ete rm in e g lo bal p ara m ete rs o f t h e c o m puta tio n. ○ O ptio ns – s , – e , – x , – r , a n d – n s h o uld b e p ro ce sse d i n t h is o rd er. T h at i s : ( 1 ) i f – s i s p re se n t, t h en fi le c o nte n t i s fi lt e re d b ase d o n t h e s p ecifi ed p ara m ete r; ( 2 ) i f – e i s p re se n t, t h en fi le c o nte n t e xclu d es l in es t h at i n clu d e t h e s p ecifi ed p ara m ete r; ( 3 ) i f – x i s p re se n t, t h en a s u ffi x s h o uld b e a p plie d ; ( 4 ) i f – r i s p re se n t, t h en r e ve rs a l o f l in e o rd er l o gic i s p erfo rm ed ; ( 5 ) i f – n i s p re se n t, t h en p ad ded l in e num berin g s h o uld b e a p plie d . ● S p ecif y in g o ptio n – i w it h o ut h avin g s p ecifi ed o ptio n – e s h o uld r e su lt i n a n e rro r. ● S p ecif y in g o ptio n – e o r – x w it h a n e m pty s trin g p ara m ete r s h o uld r e su lt i n a n e rro r. ● S p ecif y in g o ptio n – n w it h a n i n te g er < 0 s h o uld r e su lt i n a n er ro r. ● S p ecif y in g o ptio n – s w it h a n i n p ut p ara m ete r n o t e q ual t o 0 o r 1 s h o uld r e su lt i n a n e rro r. E ach fi le s ta rt s w it h l in e 1 , w hic h s h o uld b e c o nsid ere d o dd. ● I f o ptio ns a re r e p eate d , o nly t h eir l a st o ccu rre n ce i s c o nsid ere d . ● A ll p ro gra m o ptio n p ara m ete rs a re r e q uir e d a n d w il l r e su lt i n a n e rro r i f o m it te d . ● Y o u s h o uld a ssu m e t h at t h e < strin g > p ara m ete rs w il l n o t c o nta in n ew lin es, a s t h e b eh avio r o f t h e p ro gra m i s p la tfo rm d ep en d en t a n d u nd efi ned i n t h o se c a se s. ● Y o u s h o uld a ssu m e t h at t h e l a st l in e o f t h e i n p ut fi le w il l b e n ew lin e-t e rm in ate d . O th erw is e , p ro gra m b eh avio r i s u nd efi ned . ○ T h e o nly e xce p tio n w ould b e a n e m pty i n p ut fi le w hic h s h o uld p ro duce a n e m pty o utp ut w it h n o o ptio ns e xec uted . E X A M PLE S O F U SA G E (In the following, “ ↵ ” represents a newline character .) E xample 1: t xted -f FILE i nput FILE : a lphanumeric123foobar ↵ ↵ e dited FILE : a lphanumeric123foobar ↵ ↵ s tdout : n othing sent to stdout s tderr : n othing sent to stderr E xample 2: t xted -e ABC FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : 0 1234abc ↵ 5 6789def ↵ 5 6789DEF ↵ ↵ s tderr : n othing sent to stderr E xample 3: t xted -e ABC -i FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : 5 6789def ↵ 5 6789DEF ↵ ↵ s tderr : n othing sent to stderr E xample 4: t xted -r FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : 5 6789DEF ↵ 0 1234ABC ↵ 5 6789def ↵ 0 1234abc ↵ ↵ s tderr : n othing sent to stderr E xample 5: t xted -s 1 FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : 5 6789def ↵ 5 6789DEF ↵ ↵ s tderr : n othing sent to stderr E xample 6: t xted -x ! FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : 0 1234abc! ↵ 5 6789def! ↵ 0 1234ABC! ↵ 5 6789DEF! ↵ ↵ s tderr : n othing sent to stderr E xample 7: t xted -n 3 FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : 0 01 01234abc ↵ 0 02 56789def ↵ 0 03 01234ABC ↵ 0 04 56789DEF ↵ ↵ s tderr : n othing sent to stderr E xample 8: t xted -n 4 -r -x !!! FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : 0 001 56789DEF!!! ↵ 0 002 01234ABC!!! ↵ 0 003 56789def!!! ↵ 0 004 01234abc!!! ↵ ↵ s tderr : n othing sent to stderr E xample 9: t xted -n 3 -r -e Bar -s 0 -n 2 -x ! -f FILE i nput FILE : a lphanumeric123foo ↵ a lphanumeric123Foo ↵ a lphanumeric123FOO ↵ a lphanumeric123bar ↵ a lphanumeric123Bar ↵ a lphanumeric123BAR ↵ a lphanumeric123foobar ↵ a lphanumeric123Foobar ↵ a lphanumeric123fooBar ↵ a lphanumeric123FooBar ↵ a lphanumeric123FOOBar ↵ a lphanumeric123FooBAR ↵ a lphanumeric123FOOBAR ↵ e dited FILE : 0 1 alphanumeric123FOOBAR! ↵ 0 2 alphanumeric123foobar! ↵ 0 3 alphanumeric123FOO! ↵ 0 4 alphanumeric123foo! ↵ ↵ s tdout : n othing sent to stdout s tderr : n othing sent to stderr E xample 10: t xted -i FILE i nput FILE : 0 1234abc ↵ 5 6789def ↵ 0 1234ABC ↵ 5 6789DEF ↵ ↵ e dited FILE : f ile not edited s tdout : n othing sent to stdout s tderr : U sage: t xted [ – f | – i | – s i nteger | – e s tring | – r | – x s tring | – n i nteger ] FILE D eliv era b le s S um mary This part of the document is provided to help you keep track of where you are in the individual project and will be updated in future deliverables. DELIVERABLE 1 (this deliverable, see below for details) ● Pr ovided: ○ txted specification ○ Skeleton of the main class for txted ○ Example tests and skeleton of the test class to submit ○ JUnit libr aries ● Expected: ○ Part I (Category Partition) ■ catpart.txt : TSL file you created ■ catpart.txt.tsl : test specifications generated by the TSLgenerator tool when run on your TSL file. ○ Part II (Junit Tests) ■ Junit tests derived from your category partition test frames ( MyMainTest.java ) DELIVERABLE 2 ● pr ovided: TBD ● expected: TBD DELIVERABLE 3 ● pr ovided: TBD ● expected: TBD DELIVERABLE 4 ● pr ovided: TBD ● expected: TBD D eliv era b le 1 : I n str u ctio n s Part I Generate between 50 and 90 test-case specifications (i.e., generated test frames) for the t xted utility using the category-partition method presented in lesson P4L2. Make sur e to watch the lesson and demo befor e getting started . When defining your test specifications, your goal is to suitably cover the domain of the application under test, including r elevant err oneous inputs and input combinations . Just to give you an example, if you were testing a calculator , you may want to cover the case of a division by zero. Do not manually generate combinations of inputs as single choices. Instead, use multiple categories and choices with necessary constraints to cause the tool to generate meaningful combinations. Using the calculator example again, you should not of fer choices “add” , “multiply” , and also “add and multiply” in a single category . In particular , make sur e to use constraints (err or and single), selector expr ession (if), and pr operties appr opriately , rather than eliminating choices, to keep the number of test cases within the specified thr esholds. Note that the domain is that of the java application under test , so you can assume that anything the shell would reject (e.g., unmatched double quotes) will not reach the application. In other words, you must test for invalid input arguments, but do not need to test for err ors involving parsing the command-line arguments befor e they ar e sent to the java application . Y ou can find more details about command-line ar gument parsing at this link . T o illustrate, the sample tests in Part II will demonstrate how input ar guments would be sent to your application. Please also keep in mind that you ar e only r equir ed to specify test inputs, but you do not have to specify the expected outcome for such inputs in Part I . It is therefore OK if you do not know how the system would behave for a specific input. Using once more the calculator example, you could test the case of a division by zero even if you did not know how exactly the calculator would behave for that input. T ools and Useful Files Y ou will use the TSLgenerator tool to generate test frames starting from a TSL file, just like we did in the demo for lesson P4L2. V ersions of the TSLgenerator for Linux, Mac OS X, and Windows, together with a user manual, are available at: ● TSLgenerator -manual.txt ● TSL generator for Linux ● TSL generator for Mac OS ● TSL generator for Windows 8 and newer ● TSL generator for Windows XP and earlier W e are also providing the TSL file for the example we used in the lesson, cp-example.txt , for your reference. Important: ● These ar e command-line tools , which means that you have to run them fr om the command line , as we do in the video demo, rather than by clicking on them. ● On Linux and Mac systems, you may need to change the permissions of the files to make them executable using the chmod utility . T o run the tool on a Mac, for instance, you should do the following, from a terminal: chmod +x TSLgenerator-mac ./TSLgenerator-mac ● Y ou can run the TSLgenerator as follows: [–manpage] [-cs] infile [-o outfile] Where < tool> is the specific tool for your architecture, and the command-line flags have the following meaning: –manpage Prints the man page for the tool. -c Reports the number of test frames that would be generated, without actually producing them . -s Outputs the result to standard output. -o outfile Outputs the result to file outfile, unless the -s option is also used . ● If you encounter issues while using the tool, please post a public question on Ed Discussion and consider running the tool on the VM provided for the class or on a dif ferent platform (if you have the option to do so). Gradescope will execute the tool on a Linux platform. Committing Part I ● Create a directory ” IndividualProject ” in the personal GitHub r epo we assigned to you . ● Add to this new directory two text files: ○ catpart.txt : TSL file you created. ○ catpart.txt.tsl : test specifications generated by the TSLgenerator tool when it processes your TSL file. ● Commit and push your files to GitHub. (Y ou can also do this only at the end of Part II, but it is always safer to have intermediate commits.) Part II In this second part of the deliverable, you will create actual test cases implementing the test specifications you created in Part I. (As discussed in the lesson on the category-partition method, each test frame is a test spec that can be instantiated as an individual concrete test case). To do so, you should perform the following steps: ● Download archive individualproject-d1.tar.gz ● Unpack the archive in the directory ” IndividualProject “, which you created in Part I of the deliverable. Hereafter , we will refer to this directory as . ● After unpacking, you should see the following structure: ○ /txted/src/edu/gatech/seclass/txted/Main.java This is a skeleton of the Main class of the txted utility , which we provide so that the test cases for txted can be compiled. It contains an empty main method and a method usage, which prints on standard error a usage message and should be called when the program is invoked incorrectly . In case you wonder , this method is provided for consistency in test results. ○ /txted/test/edu/gatech/seclass/txted/MainTest.java This is a test class with a few test cases for the txted utility that you can use as an example and that correspond to the examples of usage of txted that we provided. In addition to providing this initial set of tests, class MainT est also provides some utility methods that you can leverage/adapt and that may help you implement your own test cases: ■ File createTmpFile() Creates a File object for a new temporary file in a platform-independent way . ■ File createInputFile*() Examples of how to create, leveraging method createTmpFile , input files with given contents as inputs for your test cases. ○ /txted/test/edu/gatech/seclass/txted/MyMainTest.java This is an empty test class in which you will add your test cases, provided for your convenience. ○ /txted/lib/junit-4.12.jar /txted/lib/hamcrest-core-1.3.jar JUnit and Hamcrest libraries to be used for the assignment. ● Use the test frames from Part I to generate additional JUnit test cases for the txted utility , one per frame, and put them in the test class MyMainTest (i.e., do not add your test cases to class MainTest ). For ease of grading, please name your test cases txtedTest1 , txtedTest2 , and so on. Each test should contain a concise comment that indicates which test frame the test case implements. Use the following format for your comments, before each test: // Frame #: Y our test frames should contain enough information to create relevant test cases. If you cannot implement your test frames as useful JUnit tests (e.g., because the test frames do not pr ovide enough information), you should r evisit Part I . Extending the calculator example, if your test frame specified a numerical input, and you realized that you should use both negative and positive numbers in your actual test case, you should revise your categories and choices so that this is reflected in your test frames ● If you ar e uncertain what the r esult should be for a test, you may make a r easonable assumption on what to use for your test oracle. While you should include a test oracle, we will not grade the accuracy of the test oracle itself. Feel free to reuse and adapt, when creating your test cases, some of the code we provided in the MainTest class. Feel also free to implement your test cases dif ferently . Basically , class MainTest is provided for your convenience and to help you get started. Whether you leverage class MainTest or not, your test cases should assume (just like the test cases in MainTest do) that the txted utility will be executed from the command line, as follows: java -cp edu.gatech.seclass.txted.Main ● Make sur e not to make calls to System.exit() within your tests, as that cr eates pr oblems for JUnit. ● F or t h is d eliv era b le , d o n ot i m ple m en t t h e t xted u tilit y , b ut o n ly t h e t e st c a se s f o r i t . T his m ea n s t h at m ost, i f n ot a ll o f y ou r t e st c a se s w ill f a il, w hic h i s f in e. Committing Part II and Submitting the Deliverable ● As usual, commit and push your code to your individual, assigned private repository . ● Make sure that all Java files are committed and pushed, including the ones we provided. ● Make also sure to commit and push the provided libraries ( lib directory). T o do so, you may need to force add the jar files (i.e., “ git add -f lib/* ”), which are typically excluded by the “ .gitignore ” file. ● Y ou can check that you committed and pushed all the files you needed by doing the following: ○ Clone a fresh copy of your personal repo in another directory ○ Go to directory IndividualProject/txted in this fresh clone ○ Compile your code. One way to do is to run, from a Unix-like shell: j avac -cp lib/* -d classes src/edu/ gatech/seclass/txted/*.java t est/edu/gatech/seclass/txted/*.java (on some platforms, you may need to first create directory “ classes ”) ○ Run your tests. Again, from a Unix-like shell, you can run: j ava -cp classes:lib/* org.junit.ru nner.JUnitCore e du.gatech.seclass.txted.MyMainTest 1 ● Submit on Gradescope a file, called submission.txt that contains, in two separate 1 I f u sin g a W in dow s-b ase d s y ste m , y o u m ay n ee d t o r u n j ava -cp “classes;lib/*” o rg.junit.runner.JUnitCore edu.gatec h.seclass.txted.MyMainTest i n ste a d . lines (1) your GT username and (2) the commit ID for your submission. For example, the content of file submission.txt for Geor ge P . Burdell could look something like the following: submission.txt g pburdell1 8 1b2f59 ● As soon as you submit, Gradescope will verify your submission by making sure that your files are present and in the correct location, as well as a few additional minor checks. If you pass all these checks, you will see a placeholder grade of 10 and a positive message from Gradescope. Otherwise, you will see a grade of 0 and an error message with some diagnostic information. Please note that: ○ a positive r esponse fr om Gradescope only indicates that you passed the initial checks and is meant to pr event a number of trivial errors ; ○ if your submission does not pass the Gradescope checks, it will not be graded and will r eceive a 0 , so please make sure to pay attention to the feedback you receive when you submit and keep in mind that you can r esubmit as many times as you want befor e the deadline. 2 Gradescope Queries I f y o u n eed c la rif ic a tio n o r h ave q uestio n s r e g ard in g G ra d esco pe o utp ut, p le ase p ost p riv a te ly o n E d D is cu ssio n ( w e w ill m ake it p ublic if a ppro p ria te ) a nd m ake s u re to a dd, w hen i t a pplie s: ● a lin k to th e G ra desco pe r e su lt s , a nd ● a ny in fo rm atio n th at m ay b e r e le va nt. T he b otto m lin e is th at, to m ake th e in te ra ctio n e ff ic ie nt, y o u s h ould m ake y o ur p osts a s s e lf – c o nta in ed a nd e asy-to -c h eck a s p oss ib le . T he fa ste r w e c a n r e sp ond to th e p osts , th e m ore s tu dents w e c a n h elp . 2 A lt h ou gh w e t e ste d t h e c h eck er, i t i s p ossib le t h at i t m ig h t n ot h an dle c o rre ctly s o m e c o rn er c a se s. I f y o u r e ce iv e f e ed back t h at s e em s t o b e i n co rre ct, p le a se c o n ta ct u s o n E d D is c u ssio n .

Writerbay.net

Do you need help with this or a different assignment? We offer CONFIDENTIAL, ORIGINAL (Turnitin/LopesWrite/SafeAssign checks), and PRIVATE services using latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and PhD writers.

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper