Ticket #2057 (closed: fixed)
Add unit test for FlatBackground for when we return the background
Reported by: | Stuart Campbell | Owned by: | Keith Brown |
---|---|---|---|
Priority: | critical | Milestone: | Release 3.0 |
Component: | Framework | Keywords: | Maintenance |
Cc: | Blocked By: | ||
Blocking: | Tester: | Anders Markvardsen |
Description
The current unit tests only test the case of returning the corrected input data and not when we return the actual background.
Change History
comment:2 Changed 10 years ago by Nick Draper
- Milestone changed from Iteration 27 to Iteration 28
Bulk move of tickets at the end of iteration 27
comment:3 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 28 to Iteration 29
Bulk move of tickets at the end of iteration 28
comment:4 Changed 9 years ago by Stuart Campbell
- Milestone changed from Iteration 29 to Iteration 30
comment:5 Changed 9 years ago by Stuart Campbell
- Owner changed from Stuart Campbell to Anyone
- Status changed from new to assigned
comment:6 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 30 to Iteration 31
Bulk move of tickets to iteration 31 at the iteration 30 code freeze
comment:7 Changed 9 years ago by Nick Draper
- Milestone changed from Iteration 32 to Iteration 33
Moved to iteration 33 at iteration 32 code freeze
comment:8 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.1 to Release 2.2
Moved at end of release 2.1
comment:10 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.3 to Release 2.4
Moved to release 2.4
comment:11 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.4 to Release 2.5
Moved at the code freeze for release 2.4
comment:12 Changed 7 years ago by Nick Draper
- Milestone changed from Release 2.5 to Release 2.6
comment:15 Changed 7 years ago by Nick Draper
- Priority changed from trivial to critical
- Keywords Maintenance added
comment:19 Changed 7 years ago by Keith Brown
FlatBackground is now deprecated. The applicable unit test will be added to the current method if it does not contain a test for it already.
Current algorithm is called CalculateFlatBackground
comment:20 Changed 7 years ago by Keith Brown
Added WithReturnBackground tests and refactored tests in general
testExec and testMeanFirst now have WithReturnBackground versions.
Code has been refactored so that the algorithm executing is now in a separate method that sets the properties accordingly for that test.
A lot of TS_ASSERT_EQUALS tests have been chaged to TS_ASSERT_DELTA tests.
Refs #2057
Changeset: 7c57db5edd78ee4f7353d1a5336f3c0574cad3d9
comment:21 Changed 7 years ago by Keith Brown
- Status changed from inprogress to verify
- Resolution set to fixed
comment:22 Changed 7 years ago by Martyn Gigg
- Status changed from verify to reopened
- Resolution fixed deleted
Please fix this GCC compiler warning and then re-close:
CalculateFlatBackgroundTest.h: In member function ‘void CalculateFlatBackgroundTest::testMeanFirstWithReturnBackground()’: CalculateFlatBackgroundTest.h:178: warning: unused variable ‘correct’
comment:23 Changed 7 years ago by Keith Brown
- Status changed from reopened to inprogress
Fixed GCC compiler warning
Fixed a compiler warning by removing an unused variable
Refs #2057
Changeset: 64c0c6a93c202f96f4d845e3544619f4c8847eb6
comment:24 Changed 7 years ago by Keith Brown
- Status changed from inprogress to verify
- Resolution set to fixed
comment:25 Changed 7 years ago by Gesner Passos
- Status changed from verify to verifying
- Tester set to Gesner Passos
comment:26 Changed 7 years ago by Gesner Passos
- Status changed from verifying to verify
- Tester Gesner Passos deleted
I do not quite agree with the way the tests were changed. By having a function 'runCalculateFlatBackground(int functindex)' I understand that you avoid repeating code, what is good, but you make the understanding of the test not straight forward. I consider that being clear in the tests is better than being efficient (they are executed only by us, not by users). But this is only my opinion. So I will just move back to the pool. Maybe, another developer will have another opinion.
comment:27 Changed 7 years ago by Keith Brown
I did originally have it clear like that, but Martyn suggested refactoring to save repeated code, so i did. I do think the result was messy too, but it was the best i could come up with having been told to group similar code and it does show each test's differences well.
comment:28 Changed 7 years ago by Anders Markvardsen
- Status changed from verify to verifying
- Tester set to Anders Markvardsen
comment:29 Changed 7 years ago by Anders Markvardsen
- Status changed from verifying to reopened
- Resolution fixed deleted
To clarify tests a bit more add brief comment to what CalculateFlatBackgroundTest does and move up the method runCalculateFlatBackground even though it is private. Someone reading the test will then briefly see the headlines of this class and method before the content of the different tests
comment:30 Changed 7 years ago by Keith Brown
- Status changed from reopened to inprogress
Moved some code and improved commenting
The method that runs the algorithm in different ways has been moved to the top.
A comment breifly mentioning what the test does has been added.
Refs #2057
Changeset: a1178353f849528281907794b779cbb1f4f88636
comment:31 Changed 7 years ago by Keith Brown
- Status changed from inprogress to verify
- Resolution set to fixed
comment:33 Changed 7 years ago by Anders Markvardsen
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/feature/2057_FlatBackground_return_test'
comment:34 Changed 7 years ago by Anders Markvardsen
requested functionality has been added
comment:35 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 2904
Bulk move of tickets to iteration 27, if your ticket is essential for Iteration 26 then move it back.