(User Acceptance) Testing TUI applications

49 views
Skip to first unread message

Roman Joost

unread,
Aug 26, 2017, 6:23:44 PM8/26/17
to Brick Users
Hi,

we're building a new mail user agent based on notmuch and using brick (https://github.com/purebred-mua/purebred). First I'd like to say that brick and vty is a wonderful piece of software. We had a small prototype ready in a couple of hours.

I've seen that the list of brick apps has grown over time and one of the things I've always wondered when it comes to text applications is a way testing them. Studying the existing applications it is interesting what approach people take for unit tests, but I suppose the challenge is to test effectfull computations in a unit test style.

Anyway to come to the point, we've come up with a way of writing user acceptance tests, by basically running the application in a tmux session, sending input and observing the application by dumping the terminal output. The code is not optimized, but has come in already very handy. Whoever is keen on doing the same can steal the code from here:

https://github.com/purebred-mua/purebred/blob/master/test/TestUserAcceptance.hs

or maybe, if people are interested perhaps we should put it in a separate package. I'm also genuinely interested what other approaches members of this group took to test their applications.

Many thanks again for brick and vty. I haven't had so much fun building an application for a long time ...

Jonathan Daugherty

unread,
Aug 27, 2017, 3:55:04 PM8/27/17
to Roman Joost, Brick Users
Hi,

> we're building a new mail user agent based on notmuch and using brick
> (https://github.com/purebred-mua/purebred). First I'd like to say
> that brick and vty is a wonderful piece of software. We had a small
> prototype ready in a couple of hours.

Fantastic! I came across your project recently. I'm glad to hear that
you're enjoying using the library. :)

> Anyway to come to the point, we've come up with a way of writing user
> acceptance tests, by basically running the application in a tmux
> session, sending input and observing the application by dumping the
> terminal output. The code is not optimized, but has come in already
> very handy. Whoever is keen on doing the same can steal the code from
> here:
>
> https://github.com/purebred-mua/purebred/blob/master/test/TestUserAcceptance.hs
>
> or maybe, if people are interested perhaps we should put it in a separate
> package. I'm also genuinely interested what other approaches members of
> this group took to test their applications.

This is awesome! I will take a look. I've been thinking of doing
something like this for other terminal applications where just testing
the internals isn't enough. Thanks for sharing it!

I'd definitely be interested to see whether you can generalize it enough
to make a package. I also love tmux, so it's neat to see it used this
way.

> Many thanks again for brick and vty. I haven't had so much fun
> building an application for a long time ...

That's really great to hear. :)

--
Jonathan Daugherty
Reply all
Reply to author
Forward
0 new messages