Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Unit Tests and System Tests #125

Closed
genu opened this issue Mar 29, 2013 · 3 comments
Closed

Unit Tests and System Tests #125

genu opened this issue Mar 29, 2013 · 3 comments
Labels

Comments

@genu
Copy link
Member

genu commented Mar 29, 2013

As I've been studying the best way to start incorporating tests in the component as described here, here is what I've learned:

Two types of tests

Unit Test

In Joomla, Unit Tests are used only for testing library specific code that can be compartmentalized, and tested as single atomic units.

In the case of JBS, we'll need to identify parts of the component that we can test individually. Most of the methods in the component rely on the joomla framework to do the work.

Perhaps, we begin to test areas of the component that we can strictly provide input and assert the output. The first area that comes to mind are the classes in admin/helpers.

I'm still yet to figure out if we can apply functional unit tests to other areas like the component models, controllers, or views.

System Tests

As mentioned in the Joomla documentation, systems tests are used to test the joomla cms from the point of view of a user. These pretty much launch a firefox and automate user clicks, and assert various parts of a rendered page for correctness.

I was able to create mock test, which tests the JBS component installation, so this is certainly a good way to test the component.

The only drawback of system tests is that they tend to take longer to run.

The joomla approach is to have both Unit Tests and System tests. They're just used for different purposes. Unit tests are used for testing the framwork, and system tests for testing the over all system.

We can take a similar approach for JBS and focus on System tests for testing the component inside joomla, and unit tests for testing component specific functionality.

Is this a good approach?

@bcordis
Copy link
Member

bcordis commented Mar 29, 2013

I think this is the right way to go. We will just have to do the test here and there. I hope we can do portions of the test and not the hole thing so we can test portions of the component without testing the howl thing.

@genu
Copy link
Member Author

genu commented Mar 29, 2013

Ok, well, if we can set up Travis-ci correctly, I think we can have it so that the tests are run for every commit automatically when pulled to github.

That would mean that 'phing build' would no longer include the unit tests.

@bcordis
Copy link
Member

bcordis commented Mar 29, 2013

I'm fine with that.

On Fri, Mar 29, 2013 at 11:22 AM, Eugen Istoc notifications@git.luolix.topwrote:

Ok, well, if we can set up Travis-ci correctly, I think we can have it so
that the tests are run for every commit automatically when pulled to github.

That would mean that 'phing build' would no longer include the unit tests.


Reply to this email directly or view it on GitHubhttps://github.com//issues/125#issuecomment-15648364
.

Thanks,
Brent Cordis
2406 Hermitage Park Dr.
Hermitage, TN 37076
615.429.6426

@bcordis bcordis closed this as completed Mar 26, 2021
@Joomla-Bible-Study Joomla-Bible-Study locked and limited conversation to collaborators Mar 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants