Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

count resets after 10ish steps #38

Closed
DrRibosome opened this issue May 3, 2014 · 9 comments
Closed

count resets after 10ish steps #38

DrRibosome opened this issue May 3, 2014 · 9 comments

Comments

@DrRibosome
Copy link

Count continually resets to 0 after 11 steps. None of the intervening numbers ever appear in app (ie, oscillates between 0 and 11). Restarting phone fixes problem

Nexus 5, most recent app version

@j4velin
Copy link
Owner

j4velin commented May 5, 2014

Grab the debug version here http://j4velin-systems.de/Pedometer.apk and send me a log if the issue occurs again, thx

@cdoremus
Copy link

I'm getting the same behavior on my Nexus 5, which has happened before. This app badly needs a suite of regression tests.

@j4velin
Copy link
Owner

j4velin commented May 23, 2014

There isn't much I can test about it. The sensor reports a step value and the app believes that value is correct

@cdoremus
Copy link

I have cloned your source code and run the MetricsReloaded plugin to calculate cyclometric complexity on your code, which is 133. What this means that you need 133 unit tests to cover all logical paths in your code base. So there is plenty to test in your project. If you push your gradle.build file to your GitHub repo, I can help you setup some tests.

@j4velin
Copy link
Owner

j4velin commented May 24, 2014

You're welcome to do some testing if you want. The most important part however is the SensorListener class and I don't see what could possible go wrong in a method like

@Override
public void onSensorChanged(final SensorEvent event) {
    steps = (int) event.values[0];
}

@cdoremus
Copy link

According to the code you have posted on GitHub, that method does a lot more than that statement. In fact it has a complexity of 15, which is the third highest of all methods in the Pedometer code base (I was wrong in reading the MetricsReloaded plugin before; Pedometer has a total method-level cyclometric complexity of 267). Anyway, as I said, I am willing to help. I did a little more putzing with your source code and discovered it comes from an ADT project. Can you push the version of HoloGraphLibrary that you are using to GitHub? I'm going to setup some Robolectric tests in a separate test project.

@j4velin
Copy link
Owner

j4velin commented May 24, 2014

Sorry, I was in the other branch. The Play Store version was from the "test" branch which is now merged into master. The version of the HoloGraphyLibrary I used is on https://bitbucket.org/j4velin/holographlibrary

@cdoremus
Copy link

Thanks. Can you push your.classpath file to Github? It would make it a lot easier to setup an ADT project locally.

@j4velin
Copy link
Owner

j4velin commented May 24, 2014

I'll post it here if that's okay:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="gen"/>
    <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    <classpathentry kind="src" path="/BaseGameUtils"/>
    <classpathentry kind="src" path="/HoloGraphLibrary"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
    <classpathentry exported="true" kind="lib" path="D:/git/Pedometer/dashclock-api-r2.0.jar"/>
    <classpathentry combineaccessrules="false" kind="src" path="/colorpicker"/>
    <classpathentry kind="output" path="bin/classes"/>
</classpath>

@j4velin j4velin closed this as completed Aug 4, 2014
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

No branches or pull requests

3 participants