Re: [Elementary-dev-community] Testing Round 2

2013-04-20 Thread Pál Dorogi
Hi,

I have just subscribed to this list and saw this thread.

> satisfactory (see this:
> http://blog.remysaissy.com/2012/11/setting-up-unit-tests-in-vala-project.html);
> however, Vala's development environment is too complicated for me (a Vala

I use similar setup and am using it heavily and it works perfectly. I
reused some libgee-s AbstracTestCase and using cmake to build and run
tests coexist /w the normal app and/or shared libs in the similar
directory structure.
The output likes this:
/ValueHolderTest/null_value_test: OK
/ValueHolderTest/string_value_test: OK
/ValueHolderTest/enum_value_test: OK
...
/AspectTriggerTest/test_trigger_discard: OK
/BindingsTest/bind_aspect_adapter_test: OK

The main test program:

static int main (string[] args) {

GLib.Test.init (ref args);

TestSuite.get_root ().add_suite (new ValueHolderTest ().get_suite ());
 
 TestSuite.get_root ().add_suite (new BindingsTest ().get_suite ());

 return GLib.Test.run ();
}

And a simple test suite /w some unit tests:

public class ModelPresenterTest : AbstractTestCase {
...
public ModelPresenterTest () {
base ("ModelPresenterTest");

add_test ("change_model_under_presenter_test",
change_model_under_presenter_test);
add_test ("base_test", base_test);

}

public override void set_up () {
 value_holder = new ValueHolder ();
}

public override void tear_down () {
value_holder = null;
}

public void change_model_under_presenter_test () {

}

> My "vision" for this experiment is that someone can set up Noise (or some
> other project) for testing, and then I (and/or other volunteers) can start
> writing a few tests for it and sort of coach the developers in TDD for the
> purpose of getting the developers to a self-sufficient state before
> potentially moving onto another project and doing the same.

I think it's a very good idea and I recommend the following post to
all of those who have never heard about nor used TDD:
http://blogs.agilefaqs.com/2011/11/01/importance-of-unit-testing-and-test-driven-development-tdd/

Also the libgee (Vala) guys are using tests heavily either.

-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : [email protected]
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] Testing Round 2

2013-04-07 Thread xapantu

Hey,

I do not really have the time to read the whole conversation, but a few 
points:


An unfinished article on the subject (lack of time, etc...): 
http://xapantu.wordpress.com/2013/04/07/writing-tests-using-ldtp-for-elementary/



I have already implented a few tests in the past (unfortunately, due to 
lack of time there is nearly nothing), for instance for scratch:
http://bazaar.launchpad.net/~elementary-apps/scratch/scratch/view/head:/scratchcore/core-tests/main.vala 
 
(and more generally all the scratchcore/ folder)
I think there were a few things for marlin/pantheon files too, but I 
cannot remember wether it has been erased by some crazy merges or not.


You can use accessibility features to do efficient testing, see mago, 
ldtp, at-spi:

https://live.gnome.org/DesktopTesting
http://ldtp.freedesktop.org/ (it looks like it is down at this moment 
but this is the most interesting one).


I recommend you to not sart with Noise, it has a complex UI (code side), 
and it does some weird things when you try to do automation with it (I 
tested, at-spi was not strong enough to work with Noise if I recall 
correctly). Marlin/pantheon-files seems a better target for an 
experiment (the widgets are simplier).


Inline replies below:

On 06/04/2013 19:56, Craig wrote:

Alright guys,

I think it would be a good start to select an application and try to 
start writing tests with it. It seems like GLib's testing environment 
should be satisfactory (see this: 
http://blog.remysaissy.com/2012/11/setting-up-unit-tests-in-vala-project.html); 
however, Vala's development environment is too complicated for me (a 
Vala noob) to get a project set up for tests.
See scratch build systems and our custom cmake modules, it should be 
sufficient to do everything you want, and quite easily I think ;) (for 
someone who knows CMake reasonably).
If someone would be willing to volunteer to get GLib's testing set up 
for Noise (or something else if they so desire) including a quick 
example test (so those of us with testing--but not Vala--experience 
can have a starting point), I would be willing to start writing tests 
and working with the project's primary developer(s) to get them 
started toward Test Driven Development (other developers with TDD 
experience also expressed interest).
Unfortunately, starting unit testing means a lot of code reorganization, 
so this is actually the point that someone needs to work on. Writing 
tests once the API is clear is the easiest part -.-


[...]

My "vision" for this experiment is that someone can set up Noise (or 
some other project) for testing, and then I (and/or other volunteers) 
can start writing a few tests for it and sort of coach the developers 
in TDD for the purpose of getting the developers to a self-sufficient 
state before potentially moving onto another project and doing the same.


Thoughts?
In my opinion, writing a few blog posts would be also an interesting 
thing, there are very few good articles about GUI testing for 
Vala/GTK/CMake.


Lucas

--
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : [email protected]
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


[Elementary-dev-community] Testing Round 2

2013-04-06 Thread Craig
Alright guys,

I think it would be a good start to select an application and try to start
writing tests with it. It seems like GLib's testing environment should be
satisfactory (see this:
http://blog.remysaissy.com/2012/11/setting-up-unit-tests-in-vala-project.html);
however, Vala's development environment is too complicated for me (a Vala
noob) to get a project set up for tests. If someone would be willing to
volunteer to get GLib's testing set up for Noise (or something else if they
so desire) including a quick example test (so those of us with testing--but
not Vala--experience can have a starting point), I would be willing to
start writing tests and working with the project's primary developer(s) to
get them started toward Test Driven Development (other developers with TDD
experience also expressed interest).

This project could serve as a test to see how well TDD can work for
elementary, and, if the experiment is deemed successful, it could serve as
a model for other projects as well.

The above is the tl;dr version.
---

My "vision" for this experiment is that someone can set up Noise (or some
other project) for testing, and then I (and/or other volunteers) can start
writing a few tests for it and sort of coach the developers in TDD for the
purpose of getting the developers to a self-sufficient state before
potentially moving onto another project and doing the same.

Thoughts?
-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : [email protected]
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp