Skip to content

Improved property test coverage and found bugs#20

Open
luisggpina wants to merge 1 commit intocldellow:masterfrom
bitslab:master
Open

Improved property test coverage and found bugs#20
luisggpina wants to merge 1 commit intocldellow:masterfrom
bitslab:master

Conversation

@luisggpina
Copy link

Hi!

In an effort to improve the coverage of the property tests in this project, this PR found a few bugs:

  • By ensuring a better distribution of the numbers generated in LengthOpsTest.decodeIdAnyLen, the property test is now able to find examples that violate assertions:
Caused by: java.lang.AssertionError: expected:<49193> but was:<-16343>                                                                                                                                              
        at org.junit.Assert.fail(Assert.java:88)                                                                                                                                                                    
        at org.junit.Assert.failNotEquals(Assert.java:834)                                                                                                                                                          
        at org.junit.Assert.assertEquals(Assert.java:645)                                                                                                                                                           
        at org.junit.Assert.assertEquals(Assert.java:631)                                                                                                                                                           
        at com.cldellow.manu.format.LengthOpsTest.decodeIdAnyLen(LengthOpsTest.java:78) 
  • By using different implementations of encoders on test ReaderTest.testVariableSize512, the property test is able to find an assertion violation:
Caused by: junit.framework.AssertionFailedError: expected:<811930252> but was:<12>                                                                                                                                  
        at junit.framework.Assert.fail(Assert.java:57)                                                                                                                                                              
        at junit.framework.Assert.failNotEquals(Assert.java:329)                                                                                                                                                    
        at junit.framework.Assert.assertEquals(Assert.java:78)                                                                                                                                                      
        at junit.framework.Assert.assertEquals(Assert.java:234)                                                                                                                                                     
        at junit.framework.Assert.assertEquals(Assert.java:241)                                                                                                                                                     
        at junit.framework.TestCase.assertEquals(TestCase.java:409)                                                                                                                                                 
        at com.cldellow.manu.format.ReaderTest.testVariableSize(ReaderTest.java:255)                                                                                                                                
        at com.cldellow.manu.format.ReaderTest.testVariableSizes(ReaderTest.java:177)                                                                                                                               
        at com.cldellow.manu.format.ReaderTest.testVariableSize512(ReaderTest.java:188)  
  • Increases the coverage on IntVectorTest.testLikeArray by ensuring the case where the array grows is included in the property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant