There’s a built in system for handling project dependencies using Defold library projects. You can read more about this system here. The library system works best for closed teams of developers sharing/reusing code. Everyone who has access to a library project has full read/write access to the project and can manage the project from the Defold Dashboard. Defold library project can be included in your project by adding them to your game .project file. You can depend on the latest version or on a specific commit (SHA1 or tag). You update the library projects using Fetch Libraries from the menu.
The thing with Defold library projects is that they don’t work well for public/open source project. In such projects you want a master project on for example GitHub from which users can either clone a read only version of the repo or fork it and modify and create pull requests. In the future you will be able to host Defold projects in external locations such as GitHub, and once that happens I’m guessing that you’ll be able to control access in a better way.
In your case it sounds like you want to use the GitHub approach. Including such a project in a Defold project would be a manual process or at least a process that has to take place outside of the Defold editor, for instance using some script to clone or update or by manually copying the project files/folder to the Defold project.
As for testing you can use any unit testing framework out there. Busted and Telescope seems to be the most popular. You can run your unit tests using a headless version of dmengine. This makes it suitable for use on CI systems such as Jenkins, TeamCity, BuildHive etc. All versions of dmengine (release, debug, headless) plus other build tools can be found here: http://d.defold.com/stable/. You can build the project from the command line using Bob: http://www.defold.com/doc/bob. Once you have built the project you run it by executing dmengine_headless from the root of your project.