[Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread Daniele S.
I read some threads focusing on TDD, so I wanted to create one where we can
continue that conversation without being offtopic.

I'd say my two cent about TDD and elementary os development.
In my opinion our current environment is obstile to TDD for serveral reason:

1. Vala doesn't support TDD out of the box (  other languages do:
http://cobra-language.com/ )
2. GLib.Test is a unit test facility that is available to Vala
applications, however it's not as advanced as CppUnit, NUnit and equivalent
3. TDD is great for libraries and backends, not so much for GUI
applications and Database driven applications.
4. TDD needs lots of fakes and mocks to be written, and that could be very
time expensive ( and tedious sometimes )

Some references to Unit testing on vala apps:
http://valadoc.org/#!api=glib-2.0/GLib.Test
http://esite.ch/2012/06/26/writing-tests-for-vala/

feel free to comment

BR,

Daniele OpenNingia Simonetti
-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread Alex Lourie
I believe that this has been discussed quite thoroughly already. For now,
TDD as a development philosophy is not really appropriate for the eOS
development. That is not a direct result of tools missing for unittesting,
but again, a development process decision.

That said, I think that testing is important for elementary, and we are
going to try and look for some automation testing. I will post my findings
shortly about that.


On Tue, Sep 3, 2013 at 3:38 PM, Daniele S. oppifjel...@gmail.com wrote:

 I do understand your point, and I agree with that. But what I want to
 discuss is not if the TDD is generally a good approach ( hint. it is )
 but if it's the right approach for a community driven project like
 elementaryOS.

 about this statement:

 So if you can test something in a language (if its build in or not) you
 can run do TDD.

 You should also consider the effort ( and the cost ). When using a
 programming language that doesn't offer unit test facilities applying TDD
 may be tedious and require lots of effort ( like writing your own test
 suite engine ).

 ( as background, I'm used to agile methods, at work we use SCRUM and PRTI,
 we are introducing TDD but at a slow rate )

 BR,

 Daniele


 2013/9/3 Michael Lazarski mich...@lazarski.me

 **

 Hello,

 TDD isn't a Technic its a mindset or a philosophy.

 It came from the Agile manifesto http://agilemanifesto.org/ .

 So if you can test something in a language (if its build in or not) you
 can run do TDD.

 Often young developers don't see the need for writing test and even
 experienced hackers don't do.

 How often where you hunting a bug and you had to log stuff to hunt the
 bug?

 Or how often you see code and you go WTF?

 Here come test in handy. Now the young padawan may ask why?

 IF a test is good written you don't need to log stuff because when you
 break something the test will tell you what and where.

 Now the young padawan says: But should't I write good code instead?

 Yes, but the god like programmer is a Myth and if you think your a good
 hacker your probably a very bad one!  Facts !

 But how test can make me faster understand someones code?

 Simple: People how have Higher Mathematics in School/College/University
 probably have seen mathematical proofs.

 Most students think that Teachers do that to annoy the shit out of you
 but this is just wrong and you probably very bad at Mathematics too...

 In Mathematical proofs like in test we can see the essence of what the
 hacker wanted to do.

 By looking at what he tested and how we can understand how things works
 and how the shouldn't.


 SO you can not test and the code must be rewritten a lot like in
 contractor. maybe not today or maybe not in 1 or 2 months but at some point
 it will happen and if the guy how wrote the shitty code is not there
 anymore you will prey for test and a documentation of the code.

 OH and when people say: look at the source and you will understand it.
 they are pretty dumb too...

 Hacking is Art! If I look at the Mona Lisa and someone else will do we
 maybe see the same thing but think very different!

 So don't be dumb! Test and Document if you have the workflow right it
 will take not more then 10 minutes of a work hour but it will save letter
 tons and tons of work hours!


 Greetings lampe2
 Gruß Michael Lazarski

 --
 life simply so other people can simply life!
 Inspired by: https://vimeo.com/17576843

 -Ursprüngliche Nachricht-
 *Von:* Daniele S. oppifjel...@gmail.com
 *Gesendet:* Die 3 September 2013 13:40
 *An:* elementary-dev-community@lists.launchpad.net
 *Betreff:* [Elementary-dev-community] about TDD (Test Driven Development)


 I read some threads focusing on TDD, so I wanted to create one where we
 can continue that conversation without being offtopic.

 I'd say my two cent about TDD and elementary os development.
 In my opinion our current environment is obstile to TDD for serveral
 reason:

 1. Vala doesn't support TDD out of the box (  other languages do:
 http://cobra-language.com/ )
 2. GLib.Test is a unit test facility that is available to Vala
 applications, however it's not as advanced as CppUnit, NUnit and equivalent
 3. TDD is great for libraries and backends, not so much for GUI
 applications and Database driven applications.
 4. TDD needs lots of fakes and mocks to be written, and that could be
 very time expensive ( and tedious sometimes )

 Some references to Unit testing on vala apps:
 http://valadoc.org/#!api=glib-2.0/GLib.Test
 http://esite.ch/2012/06/26/writing-tests-for-vala/

 feel free to comment

 BR,

 Daniele OpenNingia Simonetti

 --

 Mailing list: https://launchpad.net/~elementary-dev-community

 Post to : elementary-dev-community@lists.launchpad.net

 Unsubscribe : https://launchpad.net/~elementary-dev-community

 More help   : https://help.launchpad.net/ListHelp


 --
 Mailing list: https://launchpad.net/~elementary-dev-community
 Post

Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread David Gomes
Hi,

Are weseriously having another thread on TDD? ~alourie said in this thread
and very well:

I believe that this has been discussed quite thoroughly already. For now,
TDD as a development philosophy is not really appropriate for the eOS
development. That is not a direct result of tools missing for unittesting,
but again, a development process decision.

There's not many of us (developers), we barely have time to fix bugs and
implent new features, let alone learning TDD and implementing tests all
over the place. Plus, you might be forgetting most of us are volunteers and
amateur programmers. Most of the elementary OS applications were written by
people with no degrees or experience in professional companies, we're not
really used to TDD and we're busy studying French and Biology for school.

If you want to implement some testing on elementary applications, go ahead
and make a branch that implements tests and we'll consider it, all this
talk is useless, especially when it's happened at least 2 times already on
this very Mailing List.

Please make your energy useful in more useful ways,
~David Munchor Gomes


On Tue, Sep 3, 2013 at 12:40 PM, Daniele S. oppifjel...@gmail.com wrote:

 I read some threads focusing on TDD, so I wanted to create one where we
 can continue that conversation without being offtopic.

 I'd say my two cent about TDD and elementary os development.
 In my opinion our current environment is obstile to TDD for serveral
 reason:

 1. Vala doesn't support TDD out of the box (  other languages do:
 http://cobra-language.com/ )
 2. GLib.Test is a unit test facility that is available to Vala
 applications, however it's not as advanced as CppUnit, NUnit and equivalent
 3. TDD is great for libraries and backends, not so much for GUI
 applications and Database driven applications.
 4. TDD needs lots of fakes and mocks to be written, and that could be very
 time expensive ( and tedious sometimes )

 Some references to Unit testing on vala apps:
 http://valadoc.org/#!api=glib-2.0/GLib.Test
 http://esite.ch/2012/06/26/writing-tests-for-vala/

 feel free to comment

 BR,

 Daniele OpenNingia Simonetti


 --
 Mailing list: https://launchpad.net/~elementary-dev-community
 Post to : elementary-dev-community@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~elementary-dev-community
 More help   : https://help.launchpad.net/ListHelp


-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread Daniele S.
Sergey,

Autopilot and Unit tests are not the same thing.
In fact, from the same Autopilot documentation:


Autopilot exists at the apex of the “testing pyramid”. It is designed to
test high-level functionality, and complement a solid base of unit and
integration tests. *Using autopilot is not a substitute for testing your
application with unit and integration tests!*. Autopilot is a very capable
tool for testing high-level feature functionality. It is not an appropriate
tool for testing low-level implementation details.


also we're not talking on mere theory or philosophy; we posted real code,
examples and documentation; also real-life experience. This is a sane
discussion.

BR,

Daniele



2013/9/3 Sergey Shnatsel Davidoff ser...@elementaryos.org

 Please make your energy useful in more useful ways


 Dear TTD proponents, while you keep spending lots of time on writing these
 mails and the time of all the other devs on reading them, ~alourie is
 looking into Autopilot and experimenting with writing tests using it.

 I encourage you to follow his example. Please stop wasting everyone's time
 and go read Autopilot 
 tutorialhttp://unity.ubuntu.com/autopilot/tutorial/tutorial.htmland write 
 some tests instead of emails. You can find existing tests for GTK
 apps 
 herehttps://code.launchpad.net/~ubuntu-testcase/ubuntu-autopilot-tests/trunkshall
  you need them.

 You can meet ~alourie in #elementary-dev if you want to catch up with what
 he's found so far. He's online most of the time, just keep in mind he's in
 GMT+4 timezone.

 --
 Sergey Shnatsel Davidoff
 OS architect @ elementary

-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread Sergey Shnatsel Davidoff
We don't write backends so we shouldn't have anything to unit test. By far
the most of the code we write deals with GUI and thus should be tested
using Autopilot.

Even if we do have something to *unit* test, the added complexity, higher
entry barrier and the time spent writing first the unit testing framework
and then the tests is unlikely to pay off.

If you disagree with the above, you're welcome to prove me wrong though.
200+ messages to mailing list have not convinced any of the core devs so
far.

You might have better luck convincing people if you come up with a unit
testing framework, cover an app with unit tests (if you manage to find
something to *unit* test in the first place) and demonstrate that it really
actually saves time in a real-life scenario.

But I expect simply helping us figure out Autopilot and write UI-driven
tests to be much more productive. Either way, the choice is yours.

-- 
Sergey Shnatsel Davidoff
OS architect @ elementary
-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread Sergey Shnatsel Davidoff

 Please make your energy useful in more useful ways


Dear TTD proponents, while you keep spending lots of time on writing these
mails and the time of all the other devs on reading them, ~alourie is
looking into Autopilot and experimenting with writing tests using it.

I encourage you to follow his example. Please stop wasting everyone's time
and go read Autopilot
tutorialhttp://unity.ubuntu.com/autopilot/tutorial/tutorial.htmland
write some tests instead of emails. You can find existing tests for
GTK
apps 
herehttps://code.launchpad.net/~ubuntu-testcase/ubuntu-autopilot-tests/trunkshall
you need them.

You can meet ~alourie in #elementary-dev if you want to catch up with what
he's found so far. He's online most of the time, just keep in mind he's in
GMT+4 timezone.

-- 
Sergey Shnatsel Davidoff
OS architect @ elementary
-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread Daniele S.
ok then,

https://code.launchpad.net/~oppifjellet/cable/message-history
in this branch I implemented some basic tests on the feature I added (
message history on cable irc client )
using GLib.Test.
Refer to my last commit (
http://bazaar.launchpad.net/~oppifjellet/cable/message-history/revision/128)

to run the tests simply build the application as usual

mkdir build
cd build
cmake ..
make

then run ./cable_tests to run all the test
or better run

gtester --verbose -o report.xml ./cable_test

to run the test and get a nice XML report.

BR,

Daniele


2013/9/3 David Gomes da...@elementaryos.org

 also we're not talking on mere theory or philosophy; we posted real code,
 examples and documentation; also real-life experience. This is a sane
 discussion.

 We don't need hypothetical examples on hypothetical apps, we want real
 examples on real apps.


 On Tue, Sep 3, 2013 at 4:08 PM, Daniele S. oppifjel...@gmail.com wrote:

 Sergey,

 Autopilot and Unit tests are not the same thing.
 In fact, from the same Autopilot documentation:

 
 Autopilot exists at the apex of the “testing pyramid”. It is designed to
 test high-level functionality, and complement a solid base of unit and
 integration tests. *Using autopilot is not a substitute for testing your
 application with unit and integration tests!*. Autopilot is a very
 capable tool for testing high-level feature functionality. It is not an
 appropriate tool for testing low-level implementation details.
 

 also we're not talking on mere theory or philosophy; we posted real code,
 examples and documentation; also real-life experience. This is a sane
 discussion.

 BR,

 Daniele



 2013/9/3 Sergey Shnatsel Davidoff ser...@elementaryos.org

  Please make your energy useful in more useful ways


 Dear TTD proponents, while you keep spending lots of time on writing
 these mails and the time of all the other devs on reading them, ~alourie is
 looking into Autopilot and experimenting with writing tests using it.

 I encourage you to follow his example. Please stop wasting everyone's
 time and go read Autopilot 
 tutorialhttp://unity.ubuntu.com/autopilot/tutorial/tutorial.htmland write 
 some tests instead of emails. You can find existing tests for GTK
 apps 
 herehttps://code.launchpad.net/~ubuntu-testcase/ubuntu-autopilot-tests/trunkshall
  you need them.

 You can meet ~alourie in #elementary-dev if you want to catch up with
 what he's found so far. He's online most of the time, just keep in mind
 he's in GMT+4 timezone.

 --
 Sergey Shnatsel Davidoff
 OS architect @ elementary



 --
 Mailing list: https://launchpad.net/~elementary-dev-community
 Post to : elementary-dev-community@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~elementary-dev-community
 More help   : https://help.launchpad.net/ListHelp



-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread Craig
What do you mean real apps? As long as the code executes, I don't see the
value in the distinction.
On Sep 3, 2013 2:30 PM, David Gomes da...@elementaryos.org wrote:

 also we're not talking on mere theory or philosophy; we posted real code,
 examples and documentation; also real-life experience. This is a sane
 discussion.

 We don't need hypothetical examples on hypothetical apps, we want real
 examples on real apps.


 On Tue, Sep 3, 2013 at 4:08 PM, Daniele S. oppifjel...@gmail.com wrote:

 Sergey,

 Autopilot and Unit tests are not the same thing.
 In fact, from the same Autopilot documentation:

 
 Autopilot exists at the apex of the “testing pyramid”. It is designed to
 test high-level functionality, and complement a solid base of unit and
 integration tests. *Using autopilot is not a substitute for testing your
 application with unit and integration tests!*. Autopilot is a very
 capable tool for testing high-level feature functionality. It is not an
 appropriate tool for testing low-level implementation details.
 

 also we're not talking on mere theory or philosophy; we posted real code,
 examples and documentation; also real-life experience. This is a sane
 discussion.

 BR,

 Daniele



 2013/9/3 Sergey Shnatsel Davidoff ser...@elementaryos.org

  Please make your energy useful in more useful ways


 Dear TTD proponents, while you keep spending lots of time on writing
 these mails and the time of all the other devs on reading them, ~alourie is
 looking into Autopilot and experimenting with writing tests using it.

 I encourage you to follow his example. Please stop wasting everyone's
 time and go read Autopilot 
 tutorialhttp://unity.ubuntu.com/autopilot/tutorial/tutorial.htmland write 
 some tests instead of emails. You can find existing tests for GTK
 apps 
 herehttps://code.launchpad.net/~ubuntu-testcase/ubuntu-autopilot-tests/trunkshall
  you need them.

 You can meet ~alourie in #elementary-dev if you want to catch up with
 what he's found so far. He's online most of the time, just keep in mind
 he's in GMT+4 timezone.

 --
 Sergey Shnatsel Davidoff
 OS architect @ elementary



 --
 Mailing list: https://launchpad.net/~elementary-dev-community
 Post to : elementary-dev-community@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~elementary-dev-community
 More help   : https://help.launchpad.net/ListHelp



 --
 Mailing list: https://launchpad.net/~elementary-dev-community
 Post to : elementary-dev-community@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~elementary-dev-community
 More help   : https://help.launchpad.net/ListHelp


-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp


Re: [Elementary-dev-community] about TDD (Test Driven Development)

2013-09-03 Thread David Gomes
also we're not talking on mere theory or philosophy; we posted real code,
examples and documentation; also real-life experience. This is a sane
discussion.

We don't need hypothetical examples on hypothetical apps, we want real
examples on real apps.


On Tue, Sep 3, 2013 at 4:08 PM, Daniele S. oppifjel...@gmail.com wrote:

 Sergey,

 Autopilot and Unit tests are not the same thing.
 In fact, from the same Autopilot documentation:

 
 Autopilot exists at the apex of the “testing pyramid”. It is designed to
 test high-level functionality, and complement a solid base of unit and
 integration tests. *Using autopilot is not a substitute for testing your
 application with unit and integration tests!*. Autopilot is a very
 capable tool for testing high-level feature functionality. It is not an
 appropriate tool for testing low-level implementation details.
 

 also we're not talking on mere theory or philosophy; we posted real code,
 examples and documentation; also real-life experience. This is a sane
 discussion.

 BR,

 Daniele



 2013/9/3 Sergey Shnatsel Davidoff ser...@elementaryos.org

  Please make your energy useful in more useful ways


 Dear TTD proponents, while you keep spending lots of time on writing
 these mails and the time of all the other devs on reading them, ~alourie is
 looking into Autopilot and experimenting with writing tests using it.

 I encourage you to follow his example. Please stop wasting everyone's
 time and go read Autopilot 
 tutorialhttp://unity.ubuntu.com/autopilot/tutorial/tutorial.htmland write 
 some tests instead of emails. You can find existing tests for GTK
 apps 
 herehttps://code.launchpad.net/~ubuntu-testcase/ubuntu-autopilot-tests/trunkshall
  you need them.

 You can meet ~alourie in #elementary-dev if you want to catch up with
 what he's found so far. He's online most of the time, just keep in mind
 he's in GMT+4 timezone.

 --
 Sergey Shnatsel Davidoff
 OS architect @ elementary



 --
 Mailing list: https://launchpad.net/~elementary-dev-community
 Post to : elementary-dev-community@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~elementary-dev-community
 More help   : https://help.launchpad.net/ListHelp


-- 
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help   : https://help.launchpad.net/ListHelp