I'm no engineer so don't take everything I say as fact (and please correct me if you do know).
I see scavenging was already mentioned, and I think the flow rate (which related to back pressure) is a huge player in exhaust design. Least resistance is not always the best design. You would need to run the motor on an engine dyno and see what flow/scavenging combo produces the most power (taking into account what type of power you are after). Then use your engineering and math skills to get your exhaust as close as possible to it.
As for sound, the math is pretty simple to figure out what size/shape of pipe is needed to cancel out certain wave lengths. Testing for those wave lengths is the issue here, as I imagine you don't have an M3 to fit a bunch of sensors to and run different types of systems.
To test safety, you would need to compare rear end crash results with/without the stock muffler. Then with your design. Also not feasible... This could be a big issue, as some cars are even engineered so the spare tire absorbs energy in an accident. And with the size/weight of our stock mufflers...
If ecology means fuel economy, then that would be part of the flow/back pressure testing. Figure out what produces the best fuel economy results and design around that.
Lots of work and $$ involved in correctly designing/testing car parts. The reason race cars costs millions to develop, and why aftermarket parts can have such a big price range. Good luck with your project, I went to VT and all of my friends wanted to do stuff like this for their senior design project. Most were turned down because it isn't feasible without a huge market (aka too expensive)...