Ismailtaktak / freemedforms

Automatically exported from code.google.com/p/freemedforms
Other
0 stars 0 forks source link

Form::Internal::EpisodeModel loses data? #308

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue was created by revision 372800023018.

We need to test this a lot. It seems like the EpisodeModel cache system loses 
data in some occasion. I can not clealy reproduce this bug.

Original issue reported on code.google.com by eric.mae...@gmail.com on 5 Apr 2013 at 4:40

GoogleCodeExporter commented 9 years ago
A test suite would help much here. I set up one in my local repository, but 
can't manage the fmf include qmake pro quirks...
We could add a test.pro subdirs project in /tests which includes all 
subdirectories there. It should NOT be part of the freemedforms.pro, should not 
be compiles everytime.
So we could add automatic testing, and create test functions with QTestLib, 
which is extremely convenient.

What'd'y'say?

Original comment by christian.a.reiter@gmail.com on 6 Apr 2013 at 9:42

GoogleCodeExporter commented 9 years ago
Yop this is much much work because of plugins interdependencies and the need of 
user interaction.
I'll think about this

Original comment by eric.mae...@gmail.com on 6 Apr 2013 at 10:09

GoogleCodeExporter commented 9 years ago
User interaction can not be tested this way, yes.
But you don't know if the bug is elsewhere, right?

And testbeds can cover all errors that will MAYBE be introduced in future as 
well. So maybe we'll create a bug in a year that stops the Episode data from 
working - such tests can stop us from doing that ;-)

Original comment by christian.a.reiter@gmail.com on 6 Apr 2013 at 10:13

GoogleCodeExporter commented 9 years ago
Yes but this test needs to access: FormItemData, EpisodeBase, XmlIo, 
PatientBase, CorePlugin...
That looks very complicated ! We can not test only the episode model because of 
its internal interdependencies.
We can add tests inside the 'real' code and activate it using a qmake CONFIG 
tag like CONFIG+=tests. Tests can then be run while the application is running 
in debug mode.
Is that possible?

Original comment by eric.mae...@gmail.com on 6 Apr 2013 at 10:17

GoogleCodeExporter commented 9 years ago
Dependencies *should* be no problem. Therefore I would add a general tests.pro 
subdirs project, and include several subprojects for that.
If you want you can then do ALL tests by compiling and running the tests.pro, 
but also run each test subproject individually.
This would be a EpisodeModel test subproject.

NO mix of test code and production code, not even in debug mode! This is a 
fauxpas! ;-)

Dependencies: each subproject must have its right dependencies.

In this case we *could* maybe overthink the dependency/include/directory 
structure/ etc. model in FMF.
QtCreator has a bit of a simpler structure - but they have no subprojects like 
FreeDiams, FreeToolBox or similar.
But I think we are generating some dependency problems by having the current 
structure - at least I am NOT able to set up a proper subproject and add the 
right include files in the .pro file.

This is kind of a general discussion - but as answer to this bug here:
definitely add a UnitTest.

Original comment by christian.a.reiter@gmail.com on 6 Apr 2013 at 11:34

GoogleCodeExporter commented 9 years ago
This is how to reproduce this bug:

- select a Patient
- Go in SOAP
- Enter "THIS SHOULDN'T BE READABLE" in S
- Ctrl+S
- Go in patient selector (do not select a patient)
- Go back in Patient file
- Change in SOAP : S 
  * Remove previous text
  * Enter "THIS DATA IS LOST"  (do not Ctrl+S)
- Click Textual Prescription  (do not Ctrl+S)
- Add something  (do not Ctrl+S)
- Click on SOAP  (do not Ctrl+S)
  -> You should see "THIS SHOULDN'T BE READABLE" in S

Original comment by eric.mae...@gmail.com on 19 Apr 2013 at 12:46

GoogleCodeExporter commented 9 years ago
Fixed by commit fe54829ddb8f77fca2d69d31e98a9b24961031e7

Original comment by eric.mae...@gmail.com on 19 Apr 2013 at 12:47

GoogleCodeExporter commented 9 years ago

Original comment by eric.mae...@gmail.com on 19 Apr 2013 at 12:48