hexapod-robot-simulator icon indicating copy to clipboard operation
hexapod-robot-simulator copied to clipboard

Add more and better tests and test cases

Open mithi opened this issue 5 years ago • 15 comments

Sample code

Please checkout how the sample test cases in:

  • https://github.com/mithi/hexapod-robot-simulator/tree/master/tests

References

Get started with testing python

  • https://realpython.com/python-testing/

Write Professional Unit Tests in Python

  • https://code.tutsplus.com/tutorials/write-professional-unit-tests-in-python--cms-25835

Web Automation Tests with Selenium

  • https://www.browserstack.com/guide/python-selenium-to-run-web-automation-test

mithi avatar Jun 17 '20 19:06 mithi

Hello =) i would be interested by helping as i know a bit of python and i used selenium for a personal project, did you code this under windows or linux? and would you mind telling me if there are specific step to take to help (or clone the repository)? i thought your project would be interesting but i never contributed before >.< so i'm sorry if my question seem dumb ^^

Veluxer avatar Jun 23 '20 11:06 Veluxer

@Veluxer !

Thank you for your interest in contributing to this project!

I tested this code on macOS, but it is currently deployed on Heroku which uses lightweight Linux containers see also:

  • https://www.heroku.com/dynos
  • https://dash.plotly.com/deployment

To get started, you can do the following:

1. Clone this repo

git clone https://github.com/mithi/hexapod-robot-simulator.git

2. Inside the repo, install the requirements

pip3 install -r requirements.txt

If you have trouble you can checkout stackoverflow https://stackoverflow.com/questions/41457612/how-to-use-requirements-txt-to-install-all-dependencies-in-a-python-project?rq=1

The other requirements are mostly for deployment, the only things you really need to install are the following:

Python 3.8.1
Plotly Dash 1.10.0
Plotly Dash Daq 0.4.0
Numpy 1.18.1

Which can easily be installed with

pip3 install dash==1.13.3
pip3 install dash_daq
pip3 install numpy

3. Check if it runs

python index.py

You should be able to see it running on your browser at Running on http://127.0.0.1:8050/

Help creating tests

As of the moment, this project has poor test coverage (as you can see it's only about 62% this means that a lot of blocks of codes are not executed when our current tests are run.

What kinds of tests to create is up to you but I suggest the best ones are the most basic ones, like making sure the page renders properly, and that the links, sliders and text boxes are working and stuff like that.

It would also be nice if more test cases are added

  • https://github.com/mithi/hexapod-robot-simulator/tree/master/tests

example test cases

  • https://github.com/mithi/hexapod-robot-simulator/blob/master/tests/ik_cases/case1.py
  • https://github.com/mithi/hexapod-robot-simulator/blob/master/tests/kinematics_cases/case1.py

You can also make test cases for the following inverse kinematics cases if you like:

Inverse Kinematics Edge Cases

  • Coxia point shoved on ground
  • Body contact shoved on ground
  • Can't reach target ground point
    • Femur length is too long
    • Tibia length is too long
    • The ground is blocking the path
  • Legs too short
    • Too many legs off the floor
    • All left legs off the ground
    • All right legs off the ground
  • Angle required is beyond range of motion
    • Alpha
    • Beta
    • Gamma

VirtualHexapod.Update Edge Cases

  • Unstable. Center of gravity is outside the hexapod's support polygon

Let me know if you have any more questions! Please don't hesitate to ask anything! Thanks again!

mithi avatar Jun 23 '20 20:06 mithi

Thanks a lot!!! That was quite clear =) i will try and reach out if i have any question!

Veluxer avatar Jun 24 '20 05:06 Veluxer

Thanks a lot!!! That was quite clear =) i will try and reach out if i have any question!

Enjoy! ❤️

mithi avatar Jun 24 '20 06:06 mithi

Hey there, I'm looking for first issues to get involved with as I foray into the world of open-source :) I wanted to see if there was still scope to get involved with solving this issue? Thank you for taking the time!

GobindB avatar Jul 20 '20 00:07 GobindB

Hey there, I'm looking for first issues to get involved with as I foray into the world of open-source :) I wanted to see if there was still scope to get involved with solving this issue? Thank you for taking the time!

Yes! :)

Please read: https://github.com/mithi/hexapod-robot-simulator/issues/104#issuecomment-648408682

and you can check out the alerts that could be triggered in this file https://github.com/mithi/hexapod-robot-simulator/blob/master/hexapod/ik_solver/helpers.py

Please let me know if you have any questions. Thanks!

mithi avatar Jul 20 '20 05:07 mithi

Hi! I am currently looking for opportunities to contribute to Github and saw that this project is a first-timer issue. Therefore, I wanted to know if this issue is still open to contribute. Thanks

RonakSharma1 avatar Aug 13 '20 05:08 RonakSharma1

Hi! I am currently looking for opportunities to contribute to Github and saw that this project is a first-timer issue. Therefore, I wanted to know if this issue is still open to contribute. Thanks

Yes, this is still open! Feel free to ask me anything if there is anything you need clarified! Thanks!

mithi avatar Aug 13 '20 06:08 mithi

Hi there, would you still like some more help on this?

myiwt avatar Sep 03 '20 19:09 myiwt

Hi there, would you still like some more help on this?

Yes, this is still open! Feel free to ask me anything if there is anything you need clarified! Thanks!

mithi avatar Sep 03 '20 19:09 mithi

Sure! Having more and better tests is always a good thing!

On Fri, Sep 4, 2020 at 3:01 AM M.YWT [email protected] wrote:

Hi there, would you still like some more help on this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mithi/hexapod-robot-simulator/issues/104#issuecomment-686697414, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMX2FI3DKBZQWICST2HE7LSD7RXPANCNFSM4OA4Y6QA .

mithi avatar Sep 04 '20 05:09 mithi

Hi, I am looking for a good opportunity to contribute to a GitHub Repository. Is this issue still open for contributions? Thanks.

sgetty avatar Dec 04 '20 22:12 sgetty

Hi, I am looking for a good opportunity to contribute to a GitHub Repository. Is this issue still open for contributions? Thanks.

Yup! Still open!

Please checkout the Contribution Guide and commit style guide

Have fun!

mithi avatar Dec 05 '20 12:12 mithi

HI @mithi is this ticket still open? I would love to contribute, please let me know.

pratheekcr avatar Jan 10 '21 02:01 pratheekcr

HI @mithi is this ticket still open? I would love to contribute, please let me know.

Hi @pratheekcr,

More and better test cases are always welcome!

Don't forget to checkout the Contribution Guide and commit style guide

Have fun!

mithi avatar Jan 10 '21 08:01 mithi