all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Merten <smerten@oekonux.de>
To: emacs-devel@gnu.org
Subject: Re: call for more ert tests
Date: Wed, 26 Jun 2013 11:22:24 +0200	[thread overview]
Message-ID: <8541.1372238544@theowa.merten-home.homelinux.org> (raw)
In-Reply-To: <t3li5z76ux.fsf@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 4301 bytes --]

Hi all!

Being a relatively new Emacs developer my impressions might be
helpful for this debate. I'm subscribed to all(?) lists but usually
check only the subject lines for things interesting me. Also I'm
maintaining rst.el and so far did not do anything else in Emacs.

2 days ago Glenn Morris wrote:
> There are a lot of bugs in Emacs. [1]
> To me, too many of these feel like breakage of things that used to work
> before, because of implementation changes, or whatever.

I share this impression. And I think it's a shame that this is so.

> One thing that could help reduce this is more unit tests.

Definitely. Together with a build bot running tests automatically.

> If you haven't used it, ERT makes it pretty easy to write tests.

Some time ago I started to care about rst.el really. I wanted to do a
lot of changes in code I did not wrote myself and today this is
nothing to do without good test support. I found ert and it did most
of what I needed. It definitely is a very good foundation.

> Of course, many aspects of Emacs's behaviour are not easy to test

In rst.el I tested a lot of functionality which operated on buffers.
Thus I wanted to know that a buffer contained a certain content after
running a function. I wrote a little extension based on ert which
allowed such tests easily. I even suggested this code here but the ert
maintainer did not like it and suggested a different approach I never
checked out.

I think this can be done in a more generalized way. For instance the
next thing I was thinking of was to check for correct fontification -
since this is one of the major features in rst.el. I already thought
about ways of extending ert for this.

IMHO ert is a perfect foundation but needs extensions to test standard
cases where you are not (only) interested in the return values of a
function call.

> (GUI
> stuff, etc.), but many are. See test/automated/ for examples. [2]

Indeed they are. Often when I browse through the documented API I
wonder why there are no unit tests for it.

> I know writing tests is maybe not as interesting as writing shiny new
> features, but I think it will save work in the long run.

Well, I love writing tests. May be there are more like me?

Yesterday Stephen J Turnbull wrote:
> Does Emacs really need that high quality?

Definitely. Emacs is probably the oldest Free Software project and
IMHO it's a shame that the traffic on the development list is that
high because of bugs. IMHO a good part of this could be prevented by
suitable unit tests. Interactive testing is nice but definitely not
enough.

> That said, I encourage the core developers to lead by example,
> creating tests, even trivial ones, whenever possible.

One obvious task would be to have unit tests for the API specified in
the info documentation. There are also good chances that the
documentation can be improved by this.

> Today's general
> programming culture is very sympathetic to testing, even to the point
> of "write tests first".

Definitely. Frankly speaking I was shocked when I entered the Emacs
community and saw that in the end there are (close to) *no* tests.

> Testing is inherently boring
> work, exploring the things that shouldn't happen, and the burden is
> heavy, because writing good tests requires good specs, which we rarely
> have.  So designing those specs (and maybe even writing them down) is
> a hidden burden of testing.

I disagree that testing is boring. To me it's interesting to catch all
those corner cases in tests and improve the specification or even the
implementation as a side effect. May be this is a tester approach
(which I'm not ;-) ).

Yesterday Lars Magne Ingebrigtsen wrote:
> ert is fine, but, I think, somewhat misguided.  It allows us to test the
> functions we have Lisp interfaces for, but not the deep internal C
> bits.  And that's kinda backward.

May be I do not understand Lars' intentions here, but what is testing
the C code good for at all? I mean there is an API - or rather: lots
of APIs - and *this* is what needs testing. The C code to me looks
like an implementation detail I'd not write tests for. Or at least
separate those tests clearly from the API tests.


						Grüße

						Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 307 bytes --]

  parent reply	other threads:[~2013-06-26  9:22 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 17:31 call for more ert tests Glenn Morris
2013-06-24 18:21 ` Eli Zaretskii
2013-06-24 18:24   ` Lennart Borgman
2013-07-01 11:35     ` Andreas Röhler
2013-07-01 16:14       ` Stefan Merten
2013-07-01 16:35         ` Andreas Röhler
2013-07-01 16:37       ` Eli Zaretskii
2013-07-01 17:35         ` Eli Zaretskii
2013-07-01 18:44           ` Stephen J. Turnbull
2013-07-01 19:32             ` Eli Zaretskii
2013-07-01 20:34         ` Dmitry Gutov
2013-06-24 18:33   ` Sebastian Wiesner
2013-06-24 18:40     ` Eli Zaretskii
2013-06-24 18:55       ` Sebastian Wiesner
2013-06-24 19:16         ` Eli Zaretskii
2013-06-24 19:20           ` Lennart Borgman
2013-06-24 19:35           ` Óscar Fuentes
2013-06-24 19:59             ` John Wiegley
2013-06-25  1:21               ` Leo Liu
2013-06-25  2:44                 ` John Wiegley
2013-06-25  3:02                   ` Stefan Monnier
2013-06-25  2:31             ` Stephen J. Turnbull
2013-06-25 14:38               ` Eli Zaretskii
2013-06-25 11:06             ` Lars Magne Ingebrigtsen
2013-06-25 12:11               ` Juanma Barranquero
2013-06-25 15:15               ` Eli Zaretskii
2013-06-25 19:18                 ` Lars Magne Ingebrigtsen
2013-06-25 20:12                   ` Eli Zaretskii
2013-06-25 20:36                   ` Sebastian Wiesner
2013-06-25 20:44                     ` Lars Magne Ingebrigtsen
2013-06-28 15:01                       ` Ted Zlatanov
2013-06-28 15:39                         ` Juanma Barranquero
2013-06-28 15:41                         ` Dmitry Gutov
2013-06-26  9:03                     ` Julien Danjou
2013-06-26  5:12                   ` Stephen J. Turnbull
2013-06-24 19:46   ` Glenn Morris
2013-06-25 13:33     ` Noah Lavine
2013-06-25 17:18   ` Rüdiger Sonderfeld
2013-06-25 18:53     ` Eli Zaretskii
2013-06-25 20:29       ` Dmitry Gutov
2013-07-01 11:45   ` Andreas Röhler
2013-07-01 12:43     ` Ted Zlatanov
2013-07-01 14:13       ` Andreas Röhler
2013-06-24 18:29 ` David Engster
2013-06-24 18:38   ` Glenn Morris
2013-06-24 19:04     ` David Engster
2013-06-25 22:15 ` Daniel Hackney
2013-06-26  9:22 ` Stefan Merten [this message]
2013-06-26 12:17   ` Bozhidar Batsov
2013-06-26 15:52     ` Eli Zaretskii
2013-06-26 16:03       ` Bozhidar Batsov
2013-06-26 16:22         ` Eli Zaretskii
2013-06-26 19:01           ` Dmitry Gutov
2013-06-26 19:10             ` Michael Albinus
2013-06-26 19:34               ` Dmitry Gutov
2013-06-26 19:56                 ` Michael Albinus
2013-06-26 19:28             ` Eli Zaretskii
2013-06-26 19:46             ` Teemu Likonen
2013-06-26 15:50   ` Eli Zaretskii
2013-06-29 15:11     ` Stefan Merten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8541.1372238544@theowa.merten-home.homelinux.org \
    --to=smerten@oekonux.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.