In this paper, a new technique for fabricating grating on the surface of porous TiNi SMA is proposed. The grating is directly written onto the surface of the specimen using the FIB milling. No photoresist is required during the lithography process. From the experimental results, it can be obviously seen that the grating fabricated by FIB milling has a better quality than that by electron beam lithography. Using the self-made FIB grating, the in-plane deformation of the porous TiNi SMA in microscale is studied by SEM moiré method. Moiré and the microscopical structures are synchronously observed, including microcracks, martensites and grain boundaries.