Construction of Law - learning tools

A, Vs and installation environment with:

Three installation methods:

  1. Download the official website: click on the download link , the browser will automatically begin downloading

  2. Thunder download, enter the following ed2k link ed2k: // | file | mu_visual_studio_community_2017_version_15.3_x86_x64_11100062.exe | 1069960 | 5984B3CD547F9F213DE21EFE5887F08D | /

  3. Baidu network disk: Link: https://pan.baidu.com/s/1jJXyRMA Password: ub6c

1) I chose the official website to download and install Community Edition 2017

   

  The download is complete, install and run the program

   

 

 

2) progress completed following interface pops up, select all the C # libraries and related components and required

   

 

 

3) Wait for the installation to complete. . .

   

4) the installation is complete select the theme and the environment

   

(Note: The second step installation, vs itself is large, try not installed on the system disk)

      Summary of issues: environment configuration did not encounter any problems, basically easy to solve.

Second, the code design ideas

     demand analysis:

  • Accepts a parameter n, the output of less than 100 arithmetic method, two to three operators.
  • Operation may not appear non-integer
  • After the exercises generate input to a file

   Ideas : a four operations of two parts: the operators and operands, a design four arithmetic class calcu.

  Attributes int type array operands, operators char array type constructor takes two parameters, int char arrays and arrays, the class attribute initial value. In the method for calculating the design category calculate1 subject among the multiplication and division, and determines whether there is a decimal generation, it returns a bool value based method for calculating the subject calculate2 addition and subtraction, and returns the result.

  Main function, to generate a random number as a number of operators, and the number of operands is more than one more operator number, random number generation operation and operators to cycle through two arrays, and the two new objects array as an argument, and calls calculate1 calculate2 result can be obtained, and output to a file calculator.txt, the channel number is generated by circulating the subject to accept parameters n.

Third, the cloning project and submit the code

cloning project

1.      Git installation

   

      Can be installed directly git command line software, or install GitHub for Windows graphical interface, two I have installed, you choose one of your own, as the ease of installation. , I use the following command line to explain git clone operation

2.     In Your new directory, blank right, select git bash here, input git clone <url> command, url refers to the position where the fork warehouse

   

3.     Use the following two commands to configure their own user name and mailbox flyers, consistent with the best GitHub account.

   

4.     Before submission to see if changes are local and add a commit, git status by verifying: As shown below, where there is nothing to commit instructions can push, has not seen here and commit add

   

The     execution git add. (Note that this point can not) and git commit -m ""

   

     We can see the implementation process, upload the changes to update the situation.

   

  View the status of discovery may push the

   

6.     Enter the git push command to bring up a GitHub login box, enter your user name and password, and then you can see the success tips are as follows:

   

 

 

   

7.     launched to the source repository pull Request (initiate a request to the warehouse to contribute code), open after the fork home page, click on the button

   

8.     into the source repository interface, click on the Create pull request button and wait for approval to complete the project uploaded.

   

Summary of issues: submit the code once, suddenly found their code is wrong, I do not know how to change, and finally ask the students as well as online information and found that as long as the changes, and then commit once on the line, eat the loss will not use github of , heihei ~ so should always use tools like these, so this small error range later.

Fourth, unit testing and regression testing

     Good writing code, testing is necessary, and unit testing is a top priority, now the code unit testing:

1.    Right-test project, the new test project, and then add a reference to the test project (this method to add steps to test the project tedious, error prone, I recommend choosing the second approach)

   

  

2.    In the code, right-blank, choose to create unit tests, the following screen appears: be determined, but pay attention to the class and method must be declared public, so after creating direct write test code without additional steps.

   

 

 

3.    Write the code in the test method templates test code (according to their source code may be)

   

 

 

4.    Open the test resource management, test -> Window -> Test Explorer, right-click to run the test method to observe operating results to see if there is wrong, my code, after several tests found entirely correct.

  

 

   

 

   

 

   

 

   

Regression testing

Regression Testing: Regression testing means that after modifying the old code, re-test to confirm the modification does not introduce new bugs or cause other code to generate an error. Automated regression testing will significantly reduce system testing , maintenance and other costs of upgrading stage . .

Run the code found in normal operation and correct calculation results, test times are correct

   

Effectiveness analysis: -> the effectiveness of an exploratory -> cpu usage

     

As can be seen from the figure the use of operating procedures cpu

    

 

 

But our program is relatively small it is more cpu usage is very small, generally pay more recycled see your cpu usage, it is easy to analyze a piece of code which codes accounted for a larger weight.

Summed up the problem: when performing unit tests follow the steps to go, and finally found the project test run in the unit class does not pass over the interface can not be used. I do not know where wrong, is that the more complex unit test project created after the last online, using a more convenient way, fewer trips to the many steps, write test code can be tested directly on ok, very convenient , also found that less behind the reference to the project, resulting in the project due to the interface is not connected.

Five. Impressions

  Benxi experiment used a better tool, first IDE (vs) then the code project management tool GitHub. This time through the use of these tools made me realize a lot of strong favorable insufficient and tools. vs testing capabilities it is a very powerful, I did not think before there is such a professional testing process, there are so handy tool before his own silly are the most stupid way to test, and there is vs many performance analysis tools, learn how to check their code cpu usage, code coverage and so on, I'll take advantage of these features can make you hungry for a more comprehensive program, as well as github really is a very powerful and very easy project management tools, but these tools need some experience, it will not issue van in front of the kind of silly. Overall, the tool is used to take advantage of, we have to learn to use tools to improve our efficiency, greater use should be

Guess you like

Origin www.cnblogs.com/1916955160hxf/p/11543244.html