项目作者: amlweems

项目描述 :
automatic test case minimization library
高级语言: Go
项目地址: git://github.com/amlweems/atmin.git
创建时间: 2017-12-11T03:30:13Z
项目社区:https://github.com/amlweems/atmin

开源协议:

下载


Automatic Test Case Minimizer

atmin is a generic test case minimization program which accepts a test case,
executor, and validator, and returns a minimized blob of data which passes the
validation check. Included in the cmd/ directory are a few examples of using
atmin.

hatmin

The first example of atmin, an HTTP request minimization program, allows
users to provide a single HTTP request and receive a minimized payload which
generally returns the same output. Validation is performed using string
matching, requiring the user to provide a sample string which should be returned
by the server when the payload succeeds. An example is shown below.

  1. $ cat req.txt
  2. GET / HTTP/1.1
  3. Host: example.org
  4. Connection: keep-alive
  5. Pragma: no-cache
  6. Cache-Control: no-cache
  7. Accept: text/plain, */*; q=0.01
  8. X-Requested-With: XMLHttpRequest
  9. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
  10. Content-Type: application/json; charset=utf-8
  11. Accept-Language: en-US,en;q=0.9
  12. Cookie: _ga=GA1.2.1953734269.1506457661; _gid=GA1.2.593597176.1512947963; _gat=1
  13. $ hatmin -request req.txt -addr example.org:443 -dry-run | grep '<h1>'
  14. <h1>Example Domain</h1>
  15. $ hatmin -request req.txt -addr example.org:443 -needle 'Example Domain'
  16. 2017/12/10 20:30:44 Stage 0: Block Normalization
  17. 2017/12/10 20:30:47 Stage 1: Block Deletion
  18. 2017/12/10 20:31:01 Stage 2: Alphabet Minimization
  19. 2017/12/10 20:31:02 Stage 3: Character Minimization
  20. 2017/12/10 20:31:02 Stage 1: Block Deletion
  21. 2017/12/10 20:31:04 Stage 2: Alphabet Minimization
  22. 2017/12/10 20:31:05 Stage 3: Character Minimization
  23. 2017/12/10 20:31:05 Stage 1: Block Deletion
  24. 2017/12/10 20:31:06 Stage 2: Alphabet Minimization
  25. 2017/12/10 20:31:07 Stage 3: Character Minimization
  26. GET / HTTP/1.0
  27. Host: example.org
  28. 0:0