I am finding the answer what is the purpose of dev folder in magento module directory.

  • Purpose of dev folder
  • Advantage of dev folder
  • Disadvantages of dev folder

2 Answers 2


Purpose of dev folder

The only 2 uses I have had with the dev folder in Magento are:

  • unit tests
  • integration tests

If you understand either of these methods, the dev folder will enable you to use phpunit and start writing your code with tests around it.

Advantage of dev folder

The advantage that I find with this folder is that it keeps all the tests separate to the core code. Often, as a developer, if I search for a string in the vendor folder, most results are tests files. So, having the test files and the code separate is a big plus in my view

Disadvantages of dev folder

The disadvantage is that you have to deal with one more folder in your code repository:

  • this folder has to be maintained (meaning if you happen to write tests and Magento evolves, then this folder's content will change). One of my practice when writing tests is to make reference on these test files and this goes out of the window if the reference I use changes often.
  • In terms of deployment to your various environments, you may want to exclude this folder so that it means less files to secure in production environment. In short, security wise, this folder can be some more work/concerns to think of

Account to Magento Dev folder/directory contains various tools for developers such as Magento Test Framework (MTF).

For more information please look into Magento Dev Docs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.