Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Constructed state, unit tests and REPLs
- Date: Thu, 3 Sep 2020 17:51:28 +0900
- From: "Curt J. Sampson" <cjs@example.com>
- Subject: Re: [tlug] Constructed state, unit tests and REPLs
- References: <20200902032052.c6trw45pkb6gizaz@iambic.cynic.net> <CAFv52OC=9M9Cf2nP_3K6HjbXhavwn1dmsedDwgKL2YLH4GekMA@mail.gmail.com> <20200902054202.qhfw6qbvioknhtnj@iambic.cynic.net> <CAFv52ODmPrjNWhv=Jb0jCyKzeNzmC=z0ZUc2nYZpcAZQ9ngtnQ@mail.gmail.com> <20200902093757.svg2xq65mxifbwrx@iambic.cynic.net> <CAFv52OCDhzXHk-PvopEEQYJERMBhVc-Ssw-TMGpaiyDjySOW8g@mail.gmail.com> <20200902142538.aaccpz5z2ljo7ieh@iambic.cynic.net> <CAFv52OB1e1RN+q9q0Y5iiJ1zG3FHas+uOC4mpZYmTgfmWYhKjA@mail.gmail.com> <20200903054305.lxs2wc5m4thv5zvs@iambic.cynic.net> <CAFv52OBS1cMmc01jLvPWg540eKXKVM+Zxdz0ZgYRMyM71UV0TQ@mail.gmail.com>
- User-agent: NeoMutt/20170113 (1.7.2)
On 2020-09-03 09:59 +0200 (Thu), Josh Glover wrote: > I write veeeeeery few unit tests these days, since REPL-driven development > frees me from the test-driven development that I found extremely useful in > languages like Java and Scala. That seems...odd. Do you not write tests because the code is "tested" sufficiently from indspection? In that case, what use is the REPL? Or do you test in the REPL? If so, doesn't get tedious typing the same tests over and over again when you could just type them once and let them be run automatically? These days I find even even switching to a REPL or command line to be too tedious; I usually just have the tests for whatever bit I'm working on run every time a source file is written. I don't know how I used to put up with moving my mouse pointer to another window, typing Esc, k, and then moving my muse pointer back again every time I wanted to run the tests, even though there's only one movement away from the home row in all of that. (I use a TrackPoint.) > I mainly develop the functions, write property-based tests, and then write > a few example-based tests (AKA unit tests) for public functions to show > people the intention of the functions and how to use them. Yeah, that's what I can't really figure out. If you feel the need for property-based tests (or any kind of tests), why not write them first? Then you needn't muck about so much with a REPL: you can just let them continue to run as you code. > I also document public functions, unless the function and argument names > are so obvious that documentation would just be restating what's already > there. ;) Well, I certainly don't write documentation for obvious stuff either, That makes most of my documentation actually design work, so that gets written first, and it's usually a plurality of the work. Almost invariably documentation and tests are each more time and work than writing the code that will run in production. > I use the ipython REPL quite a bit when developing Python, and find it > fairly decent for the way I want to work, but the Emacs integration isn't > there to let me quickly evaluate code and keep going. I lean heavily on > ipython's history search. Ironically, it sounds as if I'm somewhat _more_ integrated than you, since I just type into vim, hit `s` to save, and see the results of everything in an adjacent window. > It would be cool if we lived in a world where you and I could sit side by > side and hack code, because it would be genuinely interesting for me to see > how you work. I really enjoy watching experienced developers work. :) Well, we do live in such a world so long as you're willing to use a few tmate windows and Telegram voice chat. (The majority of my pair programming outside of work has been remote like this for years now.) Poke me on Telegram at @cjs_cynic if you want to try it out. (Or Google Hangouts/Meet will probably also work, albeit it's somewhat more heavyweight. My e-mail address finds me there.) cjs -- Curt J. Sampson <cjs@example.com> +81 90 7737 2974 To iterate is human, to recurse divine. - L Peter Deutsch
- Follow-Ups:
- Re: [tlug] Constructed state, unit tests and REPLs
- From: Josh Glover
- References:
- Re: [tlug] "Go Considered Harmful"
- From: Curt J. Sampson
- Re: [tlug] "Go Considered Harmful"
- From: Josh Glover
- Re: [tlug] "Go Considered Harmful"
- From: Curt J. Sampson
- Re: [tlug] "Go Considered Harmful"
- From: Josh Glover
- Re: [tlug] "Go Considered Harmful"
- From: Curt J. Sampson
- Re: [tlug] "Go Considered Harmful"
- From: Josh Glover
- Re: [tlug] "Go Considered Harmful"
- From: Curt J. Sampson
- Re: [tlug] "Go Considered Harmful"
- From: Josh Glover
- [tlug] Constructed state, unit tests and REPLs
- From: Curt J. Sampson
- Re: [tlug] Constructed state, unit tests and REPLs
- From: Josh Glover
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Constructed state, unit tests and REPLs
- Next by Date: Re: [tlug] Call for presenters 12th Sep
- Previous by thread: Re: [tlug] Constructed state, unit tests and REPLs
- Next by thread: Re: [tlug] Constructed state, unit tests and REPLs
- Index(es):