From 5f5a4863cce2a003237ef860497bf28e57420324 Mon Sep 17 00:00:00 2001 From: Derek Date: Thu, 15 Oct 2020 11:23:31 -0400 Subject: [PATCH] commit in pieces 1/n --- auto-refactor-tests/auto-refactor-tests.html | 307 ++++++++++++++++++ auto-refactor-tests/auto-refactor-tests.html~ | 307 ++++++++++++++++++ auto-refactor-tests/auto-refactor-tests.org | 43 +++ 3 files changed, 657 insertions(+) create mode 100644 auto-refactor-tests/auto-refactor-tests.html create mode 100644 auto-refactor-tests/auto-refactor-tests.html~ create mode 100644 auto-refactor-tests/auto-refactor-tests.org diff --git a/auto-refactor-tests/auto-refactor-tests.html b/auto-refactor-tests/auto-refactor-tests.html new file mode 100644 index 0000000..f5d90ff --- /dev/null +++ b/auto-refactor-tests/auto-refactor-tests.html @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + +
+ + +
+

Auto rewrite unit tests [2018-06-11 Mon 19:33]

+
+
+
+

Suggest

+
+

+Can unit tests be reduced to a form where machines can rewrite them +automatically? A first approach might be diff'ing the parse trees +between the (current AST) and (AST previous commit). Then using the +diff to produce an automatic translation from (AST of tests from previous +commit) to the current commit. +

+ +

+This must be possible, maybe not with current tools, but people do it +manually all the time and it's generally regarded as one of the more +mundane tasks. Tests usually contain just enough state to test one +function or method, it's a very constrained use of the library under +test's API, so code with the least possible complexity to demonstrate +soundness. +

+ +

+Maybe building abstractions over the API usage itself, to describe how +it is used, a generalized test protocol. Bonus, something like this +could generate documentation. +

+
+
+ +
+

AutoProtocols

+
+
+
+

TestProtocolFoo

+
+
    +
  • construct datatype
  • +
  • assert pre conditions
  • +
  • test property
  • +
  • assert post conditions
  • +
+
+
+ +
+

TestProtocolBarDB

+
+
    +
  • init database
  • +
  • assert pre conditions
  • +
  • commit data
  • +
  • HTTP POST
  • +
  • assert post conditions
  • +
+
+
+
+
+
+
+

Author: Derek Rhodes

+

Created: 2018-07-29 Sun 22:12

+

Validate

+
+ + diff --git a/auto-refactor-tests/auto-refactor-tests.html~ b/auto-refactor-tests/auto-refactor-tests.html~ new file mode 100644 index 0000000..343b7e8 --- /dev/null +++ b/auto-refactor-tests/auto-refactor-tests.html~ @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + +
+ + +
+

Auto rewrite unit tests [2018-06-11 Mon 19:33]

+
+
+
+

Suggest

+
+

+Can unit tests be reduced to a form where machines can rewrite them +automatically? A first approach might be diff'ing the parse trees +between the (current AST) and (AST previous commit). Then using the +diff to produce an automatic translation from (AST of tests from previous +commit) to the current commit. +

+ +

+This must be possible, maybe not with current tools, but people do it +manually all the time and it's generally regarded as one of the more +mundane tasks. Tests usually contain just enough state to test one +function or method, it's a very constrained use of the library under +test's API, so code with the least possible complexity to demonstrate +soundness. +

+ +

+Maybe building abstractions over the API usage itself, to describe how +it is used, a generalized test protocol. Bonus, something like this +could generate documentation. +

+
+
+ +
+

AutoProtocols

+
+
+
+

TestProtocolFoo

+
+
    +
  • construct datatype
  • +
  • assert pre conditions
  • +
  • test property
  • +
  • assert post conditions
  • +
+
+
+ +
+

TestProtocolBarDB

+
+
    +
  • init database
  • +
  • assert pre conditions
  • +
  • commit data
  • +
  • HTTP POST
  • +
  • assert post conditions
  • +
+
+
+
+
+
+
+

Author: Derek Rhodes

+

Created: 2018-07-27 Fri 09:26

+

Validate

+
+ + diff --git a/auto-refactor-tests/auto-refactor-tests.org b/auto-refactor-tests/auto-refactor-tests.org new file mode 100644 index 0000000..1911f9d --- /dev/null +++ b/auto-refactor-tests/auto-refactor-tests.org @@ -0,0 +1,43 @@ +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +#+OPTIONS: toc:nil +#+OPTIONS: num:nil + + +* Auto rewrite unit tests [2018-06-11 Mon 19:33] + +** Suggest +Can unit tests be reduced to a form where machines can rewrite them +automatically? A first approach might be diff'ing the parse trees +between the (current AST) and (AST previous commit). Then using the +diff to produce an automatic translation from (AST of tests from previous +commit) to the current commit. + +This must be possible, maybe not with current tools, but people do it +manually all the time and it's generally regarded as one of the more +mundane tasks. Tests usually contain just enough state to test one +function or method, it's a very constrained use of the library under +test's API, so code with the least possible complexity to demonstrate +soundness. + +Maybe building abstractions over the API usage itself, to describe how +it is used, a generalized test protocol. Bonus, something like this +could generate documentation. + +** AutoProtocols +*** TestProtocolFoo +- construct datatype +- assert pre conditions +- test property +- assert post conditions + +*** TestProtocolBarDB +- init database +- assert pre conditions +- commit data +- HTTP POST +- assert post conditions + +