FIT For. NET (2)

Source: Internet
Author: User
We have introduced FIT (FIT For. NET (0), FIT For. NET (1). The following describes how to use it.

Customer participation is critical to software success. as a programmer, you need a way to understand the customer's needs, so that you can write good software. FIT provides you and your customers with a way to communicate and collaborate accurately.

For its core, FIT is just a very simple tool. it is a Framework For integrated testing (the full name of FIT). That is to say, it is a document For translating HTML and running them on your software, then the framework of the report results in HTML format. these are examples of your customer writing. fixture used to hook these tests into your software is written by yourself.

. The simplicity of FIT masks its practicality. although FIT runs the test, it is not about the test. it provides your customers with a method for what your software does. and provide you with a way to discuss details with your customers.

Because FIT can read and write HTML, and because Word and similar commercial tools can read and write HTML, your customers can directly write FIT documents. this is crucial. one problem with Requirement documents is that these documents are not prepared by the customer. even customers seldom read them. as a result, we lost valuable opportunities for cooperation. there are countless such events... this is also true for large projects. the details of each error is a Bug in the software. we need a way for the customer to consider the details and discuss them with us.

FIT is a method. it allows the customer to provide instances with correct behaviors and to see what the software can do with these instances. he allows the customer to own these instances. this is very important. encourage them to do this. give them feedback and control they will get. customer participation is important to the success of the software. FIT will help you get this. If you do this, your software will be better.

Use FIT to work with customers

Most of the use of FIT is to help customers participate, so you should read from IntroductionToFit and CustomersQuickStartGuide. start. pay attention to the lifecycle of FIT and find the way you can help customers participate. From the programmer's perspective, this section does not reflect CustomersQuickStartGuide.

When you start to develop a new feature, you should discuss it with your customers (here, for "customers", we mean: "From a business perspective, people who know the most about features "," some people call them theme event experts ") Use whiteboards to collect and listen to customers' explanations. then ask him/her to describe the examples of feature usage.

Many customers prefer to discuss the application interface, rather than the underlying requirements. in the initial stage, you may get examples discussed by users, rather than the underlying business rules. these examples blur the customer's real needs, and they are very difficult to compile and maintain.

You should gradually take charge of your customers to discuss examples of business rules. for example, if the customer says "the accountant presses this button, it will get a time card and calculate the employee's salary", you can ask the example of the time card and the final salary.

Your customer describes the example and you should try your best to think about the problem. use these questions to get additional examples that describe the answer to the question. sometimes your customers do not know or are entangled in this issue. in this case, put it aside.

You have some key examples to help your customers convert the examples into tables. try to work with the table and FIT Fixture now. (More fixture is available below). For example. once you are satisfied with the table, redefine their format so that you can easily implement it with FIT. when you do this, be careful not to omit the customer's point of view.

When you implement features, you are willing to pass through the issues that are not covered by the instance and report these issues to the customer. Like before, you can use them to help you guide the customer to generate additional examples.

FIT is not only a way to get details from customers, but also a way for your customers to get feedback from your programs. shows your customers how to use FIT, describes how he/she makes changes to FIT, returns FIT, and views results. this will allow your customers to test and generate more examples. you want your customer to say, "I want to know how the software handles this situation ...? ", Then you can get the answer by adding additional examples in the FIT document.

Run FIT

The remaining documents discuss the technical aspects of using FIT. for more information about your FIT version, see TechnicalReference. we have quickly covered many aspects, so you can also look at the example in FitDocumentation, such as SimpleExample.

FIT is a command line tool (see "TechnicalReference. FIT Command Line "), which allows you to easily include it in your script. it gets a single HTML file, processes it, and outputs the result (a backup of its real-time input file, but the cell is marked in red and green)

Many commercial tools Save documents As HTML. For example,. Word. Only "File --> Save As" is required, and then HTML. FIT works well for the files saved As HTML.

Excel can also save the document as HTML. however, it saves the entire document as a huge table. as a result, FIT cannot work directly on Excel documents. you can copy an Excel file to Word. they will span as tables and work well.

Table and Fixtures 



FIT instances are stored in the table. FIT returns the <table>, <tr>, and <td> tags of HTML. generally, it does not know how to break down HTML. this intentional design decision allows FIT to be kept simple and more complex, rather ugly HTML work.

FIT starts from the first table of the document and processes each table. each table has a fixture related to it. this fixture is used to process this table. fixture runs the code, makes changes to their tables (such as marked red and green), and returns the results to FIT.

Fixture is compiled by yourself (see TechnicalReference. "Fixture basics"), a Fixture is like a small translator in the table. each table created by a customer requires a Fixture, but you can use them for multiple tables.

. For example, in the following figure, a table is called "Payroll. fixtures. weeklyCompensation "to process, FIT needs to know which table fiture executes. place the full name of fixture in the leftmost cell of the table. for example, in a table. fixtures. weeklyCompensation ". to process.

 

Inside Fixture

Your fixture can do anything they want to do on the table, including adding rows and cells (see TechnicalReference for how to search). However, most fixture only indicates that cells are correct and wrong. here are some marked rules:

  • GreenFixture compares cells and software. They match
  • Red(Including the "expected" and "actual" sections): Fixture compares cells and software, they do not match
  • Yellow:Fixture Error
  • Gray textIn white background: the cell is empty, so fixture displays its answer
  • Black textGray background:Fixture ignores Cells

Here are some keywords that Fixture looks for in the table:

  • A completeSpace (Blank cell ):Fixture tries to fill in the answer (it will give the cell the gray color described above)
  • Word "Blank ":Fixture translates it into an empty string. (It does this because a actually empty cell means "giving me an answer", as mentioned above)
  • Word "error ":Fixture expects an error. If the error occurs, the cell will be marked green, not normal yellow.

The fixture that follows you to achieve your goals. They are described as follows. Simply put, they are:

  • ColumnFixture
  • RowFixture
  • ActionFixture
  • SummaryFixture

ColumnFixture

ColumnFixture is the simplest programming fixture and the most useful one. You should always use ColumnFixture.

A ColumnFixture is an example of a single row in the table. A table can contain multiple instances and one row, as shown below:

 

Why is it "column" fixture? Because each column in the table maps an object or method in your fixture. FIT uses the second row and column header for ing.

When a column header ends with parentheses, fixture calls a method instead of setting a variable. fixture looks at the value returned from the method, compares it with the value in the table, and then obtains the green color in red according to the situation.

As a result, writing your own ColumnFixture is almost insignificant. The above Fixture written in C # is described:

 

ColumnFixtures is processed from left to right, from top to bottom. According to the two figures above, it seems that you and the customer have written the following code:

 // Row 1 StandardHours = 40;     // the StandardHours column HolidayHours = 0;     // the HolidayHours column Wage = new Currency("20");     // the Wage column CompareResults(new Currency($800), Pay());  // the Pay() column

// Row 2 StandardHours = 45; HolidayHours = 0; Wage = new Currency("20"); CompareResults(new Currency($950), Pay());

// etc...

Note that the variables are not cleared between rows.

The following articles will introduce two important classes of FIT: ColumnFixture and RowFixture.

(--- Continued --)

Which of the above comes from the source http://fit.c2.com/wiki.cgi? ProgrammersQuickStartGuide, which is written by myself and translated by myself.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.