In my understanding there are two major differences:
Program Slicing creates a reduced representant of a program which should still produces the same output for a given input. So you reduce the given program to its core functionality and you throw away all the clumpy/insignificant attachments.
In contrast a Taint Analysis traces the path of an information through an application and observes all the objects which are affected/visited/influenced by the corresponding information. Therefor a specific input is labeled or tagged, so it could be tracked during its execution.
So you have a reduced representation of a program with consideration of input output behavior VS the trail of a selected input/variable within a program and its dependencies.
See also detailed descriptions below:
Program slicing tries to reduce a given program
P to a minimum form, a so called slice
S, which produces the same behavior. More formally taken from these slides:
- produce a slice
S from a given program
P by deleting statements
- slice must be syntactically correct a given set of variables
- should produce the same output when given to
Taint analysis can be seen as a form of Information Flow Analysis. A more formal definition ripped from here:
Information flows from object x to object y, denoted x→y , whenever
Information stored in x is transferred to, object y.