Test (ABC, def); => test (test1, test2);

sed -E "s/(test\().*(\);)/\1test1,test2\2/g" #test(abc,def); => test(test1,test2);
Terrible Tarantula